compatibility fixes after migrating to manifest v3

This commit is contained in:
Rpsl 2021-07-27 10:13:39 +03:00
parent 3ddfd67ddd
commit 430e170c33
4 changed files with 6 additions and 3 deletions

Binary file not shown.

View File

@ -17,7 +17,7 @@ chrome.runtime.onInstalled.addListener(function () {
chrome.contextMenus.onClicked.addListener(function (item, tab) {
chrome.storage.sync.get(['metube'], function (data) {
if (data === undefined || !data.hasOwnProperty('metube') || data.metube === "") {
openTab(chrome.extension.getURL('options.html'), tab);
openTab(chrome.runtime.getURL('options.html'), tab);
return
}
@ -53,7 +53,7 @@ chrome.contextMenus.onClicked.addListener(function (item, tab) {
chrome.action.onClicked.addListener(function (tab) {
chrome.storage.sync.get(['metube'], function (data) {
if (data === undefined || !data.hasOwnProperty('metube') || data.metube === "") {
openTab(chrome.extension.getURL('options.html'), tab);
openTab(chrome.runtime.getURL('options.html'), tab);
return
}

View File

@ -1,7 +1,7 @@
{
"name": "MeTube Downloader",
"description": "Use the context menu to send video into MeTube application",
"version": "1.0",
"version": "1.1",
"manifest_version": 3,
"permissions": ["contextMenus", "storage", "tabs"],
"background": {

View File

@ -16,6 +16,9 @@ async function saveOptions() {
async function restoreOptions() {
chrome.storage.sync.get(['metube'], function (data) {
if (data.metube === undefined) {
return
}
document.getElementById("metube").value = data.metube;
});
}