Skip to content

Commit

Permalink
Fixed firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvd committed Dec 4, 2024
1 parent f654526 commit 9408514
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 1 addition & 2 deletions src/manifests/safari.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
}
},
"background": {
"scripts": ["scripts/constants.js", "scripts/background.js"],
"persistent": false
"service_worker": "scripts/background.js"
},
"commands": {
"_execute_action": {
Expand Down
13 changes: 3 additions & 10 deletions src/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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
Expand All @@ -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");
});
4 changes: 2 additions & 2 deletions xcode/Turn-Off-the-Lights-Safari-extension/Config.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file not shown.

0 comments on commit 9408514

Please sign in to comment.