Skip to content

Commit

Permalink
Merge pull request #46 from foooomio/release
Browse files Browse the repository at this point in the history
Release v3.0.3
  • Loading branch information
foooomio authored Jun 13, 2024
2 parents 92b89c3 + b0b955b commit d8873e8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
2 changes: 2 additions & 0 deletions manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ set -euo pipefail
case "$1" in
'chrome')
jq '.background|={"service_worker": "background.js"}' < src/manifest.json | \
jq '.incognito|="split"' | \
jq 'del(.browser_specific_settings)' > tmp/manifest.json
mv tmp/manifest.json src/manifest.json
yarn prettier --write src/manifest.json
;;
'firefox')
jq '.background|={"scripts": ["background.js"]}' < src/manifest.json | \
jq 'del(.incognito)' | \
jq '.browser_specific_settings|={"gecko":{"id":"{f1f7b448-d666-46c6-9dfa-3ee4c5c83578}"}}' > tmp/manifest.json
mv tmp/manifest.json src/manifest.json
yarn prettier --write src/manifest.json
Expand Down
27 changes: 13 additions & 14 deletions src/background.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
'use strict';

chrome.runtime.onInstalled.addListener(() => {
chrome.contextMenus.create(
{
contexts: ['page', 'frame', 'selection', 'link', 'editable', 'image'],
id: 'background_img',
title: chrome.i18n.getMessage('extName'),
},
() => {
if (chrome.runtime.lastError) {
console.log(chrome.runtime.lastError);
}
},
);
});
chrome.contextMenus.create(
{
contexts: ['page', 'frame', 'selection', 'link', 'editable', 'image'],
documentUrlPatterns: ['http://*/*', 'https://*/*', 'file:///*/*'],
id: 'background_img',
title: chrome.i18n.getMessage('extName'),
},
() => {
if (chrome.runtime.lastError) {
console.log(chrome.runtime.lastError);
}
},
);

const cache = new Map();

Expand Down
7 changes: 4 additions & 3 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "__MSG_extName__",
"version": "3.0.2",
"version": "3.0.3",
"description": "__MSG_extDescription__",
"default_locale": "en",
"permissions": ["contextMenus"],
Expand All @@ -10,7 +10,7 @@
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"matches": ["http://*/*", "https://*/*", "file:///*/*"],
"js": ["content.js"],
"run_at": "document_start",
"all_frames": true
Expand All @@ -21,5 +21,6 @@
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
}
},
"incognito": "split"
}

0 comments on commit d8873e8

Please sign in to comment.