-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mv3: changed background to specify a service_worker * mv3: browserAction → action * package scripts now create 2 release files, supporting manifest 2 (for firefox) & 3 (for chrome)
- Loading branch information
1 parent
270b675
commit 58649de
Showing
7 changed files
with
100 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
</head> | ||
<body> | ||
<script type="module" src="background.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
NAME = local_time | ||
VERSION = 0_5_1 | ||
VERSION = 0_5_3 | ||
BUILD_DIR = release | ||
BUILD_FILE = $(BUILD_DIR)/$(NAME)_$(VERSION).zip | ||
FILES = browser-polyfill.js core.js content.js background.js manifest.json LICENSE icon-512.png icon-128.png options.js options.html popup.css button*.png | ||
MASTER_FILE = $(BUILD_DIR)/$(NAME)_$(VERSION).zip | ||
FIREFOX_FILE = $(BUILD_DIR)/$(NAME)_FF_$(VERSION).zip | ||
CHROME_FILE = $(BUILD_DIR)/$(NAME)_CHROME_$(VERSION).zip | ||
SRC = browser-polyfill.js core.js content.js background.js background.html options.js options.html popup.css | ||
ICONS = icon-512.png icon-128.png button*.png | ||
FILES = $(SRC) $(ICONS) manifest_v2.json manifest_v3.json LICENSE | ||
|
||
.DEFAULT_GOAL := build | ||
|
||
.PHONY : clean | ||
clean: | ||
rm -rf $(BUILD_FILE) | ||
@echo "Release zip deleted - " $(BUILD_FILE) | ||
rm -rf $(BUILD_DIR)/*.* | ||
|
||
$(BUILD_FILE) : $(FILES) | ||
$(MASTER_FILE) : $(FILES) | ||
@mkdir -p $(@D) | ||
zip -r9T $@ $(FILES) | ||
|
||
$(FIREFOX_FILE) : $(MASTER_FILE) | ||
cp $(MASTER_FILE) $(FIREFOX_FILE) | ||
printf "@ manifest_v2.json\n@=manifest.json\n" | zipnote -w $(FIREFOX_FILE) | ||
|
||
$(CHROME_FILE) : $(MASTER_FILE) | ||
cp $(MASTER_FILE) $(CHROME_FILE) | ||
printf "@ manifest_v3.json\n@=manifest.json\n" | zipnote -w $(CHROME_FILE) | ||
|
||
chrome: $(CHROME_FILE) | ||
|
||
firefox: $(FIREFOX_FILE) | ||
|
||
.PHONY : build | ||
build: $(BUILD_FILE) | ||
build: chrome firefox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "Localise Timezones", | ||
"description": "Converts times to your local time zone", | ||
"version": "0.5.3", | ||
"icons": { | ||
"128": "icon-128.png", | ||
"512": "icon-512.png" | ||
}, | ||
"action": { | ||
"default_title": "Localise Timezones", | ||
"default_icon": { | ||
"128": "button.png" | ||
} | ||
}, | ||
"options_ui": { | ||
"page": "options.html" | ||
|
||
}, | ||
"permissions": [ | ||
"storage" | ||
], | ||
"background": { | ||
"service_worker": "background.js", "type": "module" | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"*://*/*" | ||
], | ||
"js": [ | ||
"browser-polyfill.js", "core.js", "content.js" | ||
], | ||
"all_frames": true, | ||
"run_at": "document_idle", | ||
"css": ["popup.css"] | ||
} | ||
] | ||
} |