diff --git a/package.json b/package.json index d2891a1..90b034e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "turn-off-the-lights-browser-extension", - "version": "4.5.3", + "version": "4.5.5", "description": "Browser extension", "homepage": "https://wwww.turnoffthelights.com", "author": "Stefan Van Damme", diff --git a/src/manifests/safari.json b/src/manifests/safari.json index a72491e..583ba69 100644 --- a/src/manifests/safari.json +++ b/src/manifests/safari.json @@ -10,8 +10,7 @@ } }, "background": { - "scripts": ["scripts/constants.js", "scripts/background.js"], - "persistent": false + "service_worker": "scripts/background.js" }, "commands": { "_execute_action": { diff --git a/src/scripts/background.js b/src/scripts/background.js index 7a41f8c..384ee86 100755 --- a/src/scripts/background.js +++ b/src/scripts/background.js @@ -28,10 +28,8 @@ To view a copy of this license, visit http://creativecommons.org/licenses/GPL/2. //================================================ // Importing the constants -// Check if the browser supports service workers -// Safari uses a background script because iOS service workers are quickly terminated -if(typeof importScripts === "function"){ - // Importing the constants only if importScripts is available +// Execute if importScripts is support such as Google Chrome and not Firefox +if(typeof importScripts !== "undefined"){ // eslint-disable-next-line no-undef importScripts("constants.js"); } @@ -1068,7 +1066,7 @@ if(chrome.storage.managed){ } function installation(){ - if(chrome.storage.managed){ + if(chrome.storage.managed && exbrowser != "firefox"){ chrome.storage.managed.get(function(items){ readgrouppolicy(items); // save in memory @@ -1082,13 +1080,8 @@ function installation(){ } chrome.runtime.onInstalled.addListener(function(){ - console.log("hello installation"); installation(); if(chrome.runtime.setUninstallURL){ chrome.runtime.setUninstallURL(linkuninstall); } -}); - -chrome.runtime.onStartup.addListener(function(){ - console.log("hello startup"); }); \ No newline at end of file diff --git a/xcode/Turn-Off-the-Lights-Safari-extension/Config.xcconfig b/xcode/Turn-Off-the-Lights-Safari-extension/Config.xcconfig index 733f219..9802d0c 100644 --- a/xcode/Turn-Off-the-Lights-Safari-extension/Config.xcconfig +++ b/xcode/Turn-Off-the-Lights-Safari-extension/Config.xcconfig @@ -9,5 +9,5 @@ // https://help.apple.com/xcode/#/dev745c5c974 // Update the version number here for all platforms -VERSION = 4.5.4 -BUILD_NUMBER = 134 +VERSION = 4.5.5 +BUILD_NUMBER = 135 diff --git a/xcode/Turn-Off-the-Lights-Safari-extension/Turn Off the Lights for Safari.xcodeproj/project.xcworkspace/xcuserdata/stefanvandamme.xcuserdatad/UserInterfaceState.xcuserstate b/xcode/Turn-Off-the-Lights-Safari-extension/Turn Off the Lights for Safari.xcodeproj/project.xcworkspace/xcuserdata/stefanvandamme.xcuserdatad/UserInterfaceState.xcuserstate index 8fcc701..06c5f54 100644 Binary files a/xcode/Turn-Off-the-Lights-Safari-extension/Turn Off the Lights for Safari.xcodeproj/project.xcworkspace/xcuserdata/stefanvandamme.xcuserdatad/UserInterfaceState.xcuserstate and b/xcode/Turn-Off-the-Lights-Safari-extension/Turn Off the Lights for Safari.xcodeproj/project.xcworkspace/xcuserdata/stefanvandamme.xcuserdatad/UserInterfaceState.xcuserstate differ