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

1.1K
Vistas
Uncaught TypeError: Failed to construct 'URL': Invalid URL in chrome extension v3 when using messages

Here is a minimal extension for chrome in v3:

manifest.json

{
  "manifest_version": 3,
  "name": "Test",
  "version": "1.0",
  "description": "Test extension",
  "icons": {
    "48": "dark.png"
  },
  "background": {
    "service_worker": "button.js"
  },
  "permissions": [
    "activeTab"
  ],
  "action": {
    "default_icon": "dark.png",
    "default_title": "Test"
  }
}

button.js

chrome.action.onClicked.addListener(tab => {
  console.log('clicked')
  chrome.tabs.sendMessage(tab.id, { value: false })
});

The API seems quite clear in the doc. So I don't understand why, when I press the plugin button, I get weird errors:

extensions.js:4187 Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at ExtensionsErrorPageElement.onSelectedErrorChanged_ (extensions.js:4187:2827)
    at Object.runObserverEffect [as fn] (polymer_bundled.min.js:1:37568)
    at runEffectsForProperty (polymer_bundled.min.js:1:37087)
    at runEffects (polymer_bundled.min.js:1:36604)
    at ExtensionsErrorPageElement._propertiesChanged (polymer_bundled.min.js:1:52973)
    at ExtensionsErrorPageElement._flushProperties (polymer_bundled.min.js:1:26564)
    at ExtensionsErrorPageElement._flushProperties (polymer_bundled.min.js:1:51737)
    at ExtensionsErrorPageElement._invalidateProperties (polymer_bundled.min.js:1:51534)
    at ExtensionsErrorPageElement._setProperty (polymer_bundled.min.js:1:51459)
    at ExtensionsErrorPageElement.Object.defineProperty.set (polymer_bundled.min.js:1:24863)
onSelectedErrorChanged_ @ extensions.js:4187
runObserverEffect @ polymer_bundled.min.js:1
runEffectsForProperty @ polymer_bundled.min.js:1
runEffects @ polymer_bundled.min.js:1
_propertiesChanged @ polymer_bundled.min.js:1
_flushProperties @ polymer_bundled.min.js:1
_flushProperties @ polymer_bundled.min.js:1
_invalidateProperties @ polymer_bundled.min.js:1
_setProperty @ polymer_bundled.min.js:1
Object.defineProperty.set @ polymer_bundled.min.js:1

What am I missing?

This is on Chromium Version 100.0.4896.75 (Build officiel) snap (64 bits)

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

I had the same exception but with another reason.

So, i see the possible solution(how to get real error message).

I've set breakpoint on failed line and check the runtimeError message.

Can be usefull for somebody.

enter image description here enter image description here

about 4 years ago · Santiago Gelvez Denunciar
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