Skip to content

Commit

Permalink
servicer worker Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvd committed Nov 28, 2024
1 parent 76cff54 commit ea616e8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 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.2",
"version": "4.5.3",
"description": "Browser extension",
"homepage": "https://wwww.turnoffthelights.com",
"author": "Stefan Van Damme",
Expand Down
2 changes: 1 addition & 1 deletion src/manifests/safari.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
},
"background": {
"service_worker": "scripts/background.js",
"scripts": ["scripts/constants.js", "scripts/background.js"],
"persistent": false
},
"commands": {
Expand Down
9 changes: 7 additions & 2 deletions src/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ To view a copy of this license, visit http://creativecommons.org/licenses/GPL/2.
//================================================

// Importing the constants
// eslint-disable-next-line no-undef
importScripts("constants.js");
// 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
// eslint-disable-next-line no-undef
importScripts("constants.js");
}

chrome.runtime.onMessage.addListener(function request(request, sender){
// eye protection & autodim & shortcut
Expand Down
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.2
BUILD_NUMBER = 132
VERSION = 4.5.3
BUILD_NUMBER = 133
Binary file not shown.

0 comments on commit ea616e8

Please sign in to comment.