Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. InstallEvents.DEV_TABS = [
  2. // tests pages
  3. "/tests/test-page/unit.html",
  4. "/tests/test-page/integration.html",
  5. // options
  6. "/options/option-page.html#settings",
  7. // test page with a specific test targeted in spec
  8. "/tests/test-page/integration.html?spec=Selector%20-%20",
  9. ]
  10.  
  11. // Execute when the extension is detected to be in developement mode
  12. InstallEvents.onDevelopmentInstall = function() {
  13. // Open the tabs
  14. InstallEvents.DEV_TABS.forEach((url)=>{
  15. browser.tabs.create({
  16. active: false,
  17. url: browser.extension.getURL(url),
  18. });
  19. });
  20.  
  21. /*** Add extra code you want to be done in Development ***/
  22. //Selector.onOpenGroupsSelector({force: true});
  23. }
  24.  
  25. /**
  26. * Init CRITICAL Event
  27. **/
  28. browser.runtime.onInstalled.addListener((details) => {
  29. // Only when the extension is installed for the first time
  30. if (details.reason === "install") {
  31. Events.Install.onNewInstall();
  32. LogManager.information(LogManager.EXTENSION_INSTALLED);
  33. // Development mode detection
  34. } else if (
  35. (Utils.isFirefox() && details.temporary)
  36. || (Utils.isChrome() && details.reason === "update"
  37. && (browser.runtime.getManifest()).version === details.previousVersion
  38. )
  39. ) {
  40. Events.Install.onDevelopmentInstall();
  41. // Extension update detection
  42. } else if (details.reason === "update"
  43. && (browser.runtime.getManifest()).version !== details.previousVersion) {
  44. Events.Install.onUpdate(details.previousVersion);
  45. LogManager.information(LogManager.EXTENSION_UPDATED);
  46. }
  47. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement