I have face some difficulties during Manifest 3 to Manifest 3 migration: nothing works. I have developed a simple Chrome extension that adds a new item in the context menu, so you can search the inserted text in some website. It works correctly in the manifest 2, but not in the 3rd. So there is manifest code (3)
{
"manifest_version": 3,
"name": "name",
"short_name": "shortN",
"description": "This extension will work someday I hope so",
"background": [{
"service_worker": [ "background.js" ]
}],
"icons": {
"128": "icons/128.png",
"48": "icons/48.png",
"32": "icons/32.png",
"16": "icons/16.png"
},
"permissions": [ "contextMenus", "tabs", "activeTab" ],
"version": "1.3"
}
And a sample of background code
chrome.runtime.onInstalled.addListener(function() {
chrome.contextMenus.create({
title: "title",
contexts: ["selection"],
id: "title1"
});
});
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === "title1") {
let getToSite = "https://*" + info.selectionText
chrome.tabs.create({index: tab.index + 1, url: getQ, selected: true});
}
})
Can someone take a look and say whats wrong with it? Im also new to JS (like, three-days-new), so I do appreciate simple explanations
Thank you!