mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 13:37:04 +03:00
Use chromep in another spot
This commit is contained in:
@@ -155,16 +155,7 @@ chrome.runtime.onInstalled.addListener(function () {
|
||||
*/
|
||||
async function registerFirefoxContentScript(options: Registration) {
|
||||
if ("scripting" in chrome && "getRegisteredContentScripts" in chrome.scripting) {
|
||||
// Bug in Firefox where you need to use browser namespace for this call
|
||||
const getContentScripts = async (filter: browser.scripting.ContentScriptFilter) => {
|
||||
if (isFirefoxOrSafari()) {
|
||||
return await browser.scripting.getRegisteredContentScripts(filter);
|
||||
} else {
|
||||
return await chrome.scripting.getRegisteredContentScripts(filter);
|
||||
}
|
||||
};
|
||||
|
||||
const existingRegistrations = await getContentScripts({
|
||||
const existingRegistrations = await chromeP.scripting.getRegisteredContentScripts({
|
||||
ids: [options.id]
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user