switch back to manifest v2

This commit is contained in:
ivan grachev 2023-12-18 02:16:39 +03:00
parent 925be95237
commit f0b69c8b4f
3 changed files with 14 additions and 24 deletions

View File

@ -151,13 +151,7 @@ function mobileRedirectFor(request, sendResponse) {
const query = encodeURIComponent(JSON.stringify(request));
browser.tabs.getCurrent((tab) => {
if (tab) {
browser.scripting.executeScript({
target: { tabId: tab.id },
func: (query) => {
window.location.href = `https://tokenary.io/extension?query=${query}`;
},
args: [query]
}).then(() => {}).catch(() => {});
browser.tabs.executeScript(tab.id, { code: 'window.location.href = `https://tokenary.io/extension?query=' + query + '`;' });
sendResponse();
}
});
@ -171,7 +165,7 @@ function genId() {
function addListeners() {
browser.runtime.onMessage.addListener(handleOnMessage);
browser.action.onClicked.addListener(handleOnClick);
browser.browserAction.onClicked.addListener(handleOnClick);
}
addListeners();

View File

@ -1,5 +1,5 @@
{
"manifest_version": 3,
"manifest_version": 2,
"default_locale": "en",
"name": "__MSG_extension_name__",
@ -15,7 +15,8 @@
},
"background": {
"service_worker": "service_worker.js"
"scripts": [ "service_worker.js" ],
"persistent": false
},
"content_scripts": [{
@ -25,7 +26,7 @@
"js": [ "ios_specific_content.js", "content.js" ]
}],
"action": {
"browser_action": {
"default_icon": {
"16": "images/toolbar-icon-16.png",
"19": "images/toolbar-icon-19.png",
@ -35,7 +36,6 @@
},
"permissions": [
"scripting",
"nativeMessaging",
"storage",
"activeTab",
@ -49,8 +49,5 @@
"tokenary://*"
],
"web_accessible_resources": [{
"resources": [ "inpage.js" ],
"matches": ["<all_urls>"]
}]
"web_accessible_resources": [ "inpage.js" ]
}

View File

@ -1,5 +1,5 @@
{
"manifest_version": 3,
"manifest_version": 2,
"default_locale": "en",
"name": "__MSG_extension_name__",
@ -15,7 +15,8 @@
},
"background": {
"service_worker": "service_worker.js"
"scripts": [ "service_worker.js" ],
"persistent": false
},
"content_scripts": [{
@ -25,7 +26,7 @@
"js": [ "macos_specific_content.js", "content.js" ]
}],
"action": {
"browser_action": {
"default_icon": {
"16": "images/toolbar-icon-16.png",
"19": "images/toolbar-icon-19.png",
@ -37,7 +38,8 @@
"permissions": [
"nativeMessaging",
"storage",
"activeTab"
"activeTab",
"tabs"
],
"host_permissions": [
@ -46,8 +48,5 @@
"https://tokenary.io/*"
],
"web_accessible_resources": [{
"resources": [ "inpage.js" ],
"matches": ["<all_urls>"]
}]
"web_accessible_resources": [ "inpage.js" ]
}