compatibility fixes after migrating to manifest v3
This commit is contained in:
parent
3ddfd67ddd
commit
430e170c33
Binary file not shown.
|
|
@ -17,7 +17,7 @@ chrome.runtime.onInstalled.addListener(function () {
|
||||||
chrome.contextMenus.onClicked.addListener(function (item, tab) {
|
chrome.contextMenus.onClicked.addListener(function (item, tab) {
|
||||||
chrome.storage.sync.get(['metube'], function (data) {
|
chrome.storage.sync.get(['metube'], function (data) {
|
||||||
if (data === undefined || !data.hasOwnProperty('metube') || data.metube === "") {
|
if (data === undefined || !data.hasOwnProperty('metube') || data.metube === "") {
|
||||||
openTab(chrome.extension.getURL('options.html'), tab);
|
openTab(chrome.runtime.getURL('options.html'), tab);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ chrome.contextMenus.onClicked.addListener(function (item, tab) {
|
||||||
chrome.action.onClicked.addListener(function (tab) {
|
chrome.action.onClicked.addListener(function (tab) {
|
||||||
chrome.storage.sync.get(['metube'], function (data) {
|
chrome.storage.sync.get(['metube'], function (data) {
|
||||||
if (data === undefined || !data.hasOwnProperty('metube') || data.metube === "") {
|
if (data === undefined || !data.hasOwnProperty('metube') || data.metube === "") {
|
||||||
openTab(chrome.extension.getURL('options.html'), tab);
|
openTab(chrome.runtime.getURL('options.html'), tab);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "MeTube Downloader",
|
"name": "MeTube Downloader",
|
||||||
"description": "Use the context menu to send video into MeTube application",
|
"description": "Use the context menu to send video into MeTube application",
|
||||||
"version": "1.0",
|
"version": "1.1",
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"permissions": ["contextMenus", "storage", "tabs"],
|
"permissions": ["contextMenus", "storage", "tabs"],
|
||||||
"background": {
|
"background": {
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@ async function saveOptions() {
|
||||||
|
|
||||||
async function restoreOptions() {
|
async function restoreOptions() {
|
||||||
chrome.storage.sync.get(['metube'], function (data) {
|
chrome.storage.sync.get(['metube'], function (data) {
|
||||||
|
if (data.metube === undefined) {
|
||||||
|
return
|
||||||
|
}
|
||||||
document.getElementById("metube").value = data.metube;
|
document.getElementById("metube").value = data.metube;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue