Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda