Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InstallEvents.DEV_TABS = [
- // tests pages
- "/tests/test-page/unit.html",
- "/tests/test-page/integration.html",
- // options
- "/options/option-page.html#settings",
- // test page with a specific test targeted in spec
- "/tests/test-page/integration.html?spec=Selector%20-%20",
- ]
- // Execute when the extension is detected to be in developement mode
- InstallEvents.onDevelopmentInstall = function() {
- // Open the tabs
- InstallEvents.DEV_TABS.forEach((url)=>{
- browser.tabs.create({
- active: false,
- url: browser.extension.getURL(url),
- });
- });
- /*** Add extra code you want to be done in Development ***/
- //Selector.onOpenGroupsSelector({force: true});
- }
- /**
- * Init CRITICAL Event
- **/
- browser.runtime.onInstalled.addListener((details) => {
- // Only when the extension is installed for the first time
- if (details.reason === "install") {
- Events.Install.onNewInstall();
- LogManager.information(LogManager.EXTENSION_INSTALLED);
- // Development mode detection
- } else if (
- (Utils.isFirefox() && details.temporary)
- || (Utils.isChrome() && details.reason === "update"
- && (browser.runtime.getManifest()).version === details.previousVersion
- )
- ) {
- Events.Install.onDevelopmentInstall();
- // Extension update detection
- } else if (details.reason === "update"
- && (browser.runtime.getManifest()).version !== details.previousVersion) {
- Events.Install.onUpdate(details.previousVersion);
- LogManager.information(LogManager.EXTENSION_UPDATED);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement