mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 16:03:25 +00:00
Add background script to reload on load. Painful fix
This commit is contained in:
13
src/background.ts
Normal file
13
src/background.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { isChrome } from '~utils/extension';
|
||||
|
||||
// Both brave and firefox for some reason need this extension reload,
|
||||
// If this isn't done, they will never load properly and will fail updateDynamicRules()
|
||||
if (isChrome()) {
|
||||
chrome.runtime.onStartup.addListener(() => {
|
||||
chrome.runtime.reload();
|
||||
});
|
||||
} else {
|
||||
browser.runtime.onStartup.addListener(() => {
|
||||
browser.runtime.reload();
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user