Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Can`t add new item to context menu in Chrome (manifest 3)

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!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!