From f4772174379eb8efd11a4b9ad1139cfb0bf66b81 Mon Sep 17 00:00:00 2001 From: Alyssa X Date: Tue, 18 Jan 2022 13:34:31 +0000 Subject: [PATCH] Updated some Firefox APIs --- firefox/background.js | 14 ++++++-------- firefox/manifest.json | 5 ++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/firefox/background.js b/firefox/background.js index 96ea2c8..cc8e9f5 100644 --- a/firefox/background.js +++ b/firefox/background.js @@ -128,15 +128,13 @@ browser.runtime.onInstalled.addListener((object) => { const s = scripts.length; for (let i = 0; i < s; i++) { - browser.scripting.executeScript({ - target: { tabId: tab.id }, - files: [scripts[i]], + browser.tabs.executeScript(tab.id, { + file: scripts[i] }); } - browser.scripting.insertCSS({ - target: { tabId: tab.id }, - files: [manifest.content_scripts[0].css[0]], + browser.tabs.insertCSS(tab.id, { + file: manifest.content_scripts[0].css[0], }); }; @@ -475,8 +473,8 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => { } break; case "search": - browser.search.query( - {text:message.query} + browser.search.search( + {query:message.query} ) break; case "restore-new-tab": diff --git a/firefox/manifest.json b/firefox/manifest.json index f1eb7c8..031ec11 100644 --- a/firefox/manifest.json +++ b/firefox/manifest.json @@ -1,8 +1,7 @@ { "name": "Omni", "description": "Supercharge Chrome with commands, shortcuts, and more", - "offline_enabled": true, - "version": "1.4.2", + "version": "1.4.3", "manifest_version": 2, "browser_action": { "default_icon": { @@ -40,6 +39,6 @@ ], "web_accessible_resources": ["content.html", "newtab.html", "assets/*", "popup.css", "popup.js"], "permissions": [ - "tabs", "activeTab", "bookmarks", "browsingData", "history", "scripting", "search" + "tabs", "activeTab", "bookmarks", "browsingData", "history", "search" ] }