Skip to content

Commit 9946bd1

Browse files
committed
Use chromep in another spot
1 parent 3b06d72 commit 9946bd1

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/background.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,7 @@ chrome.runtime.onInstalled.addListener(function () {
155155
*/
156156
async function registerFirefoxContentScript(options: Registration) {
157157
if ("scripting" in chrome && "getRegisteredContentScripts" in chrome.scripting) {
158-
// Bug in Firefox where you need to use browser namespace for this call
159-
const getContentScripts = async (filter: browser.scripting.ContentScriptFilter) => {
160-
if (isFirefoxOrSafari()) {
161-
return await browser.scripting.getRegisteredContentScripts(filter);
162-
} else {
163-
return await chrome.scripting.getRegisteredContentScripts(filter);
164-
}
165-
};
166-
167-
const existingRegistrations = await getContentScripts({
158+
const existingRegistrations = await chromeP.scripting.getRegisteredContentScripts({
168159
ids: [options.id]
169160
});
170161

0 commit comments

Comments
 (0)