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

394
Vistas
Sending message from a page to Chromium (Edge) extension returns an error

There're a number of similar questions here, but none of them seem to apply to sending messages from a regular web page directly to an extension.

Chrome docs state that this is possible without using content scripts.

I've allowed external callers in manifest.json:

  "externally_connectable": {
    "matches": [
      "http://localhost/*",
      "http://host.local/*"
    ]

But performing a call as follows yields Uncaught Error: Attempting to use a disconnected port object:

port = chrome.runtime.connect(editorExtensionId);
port.postMessage(editorExtensionId, { connect: true },
    function (response) {
        console.log(response.message);
    });

On the other hand, sending messages directly works via chrome.runtime.sendMessage(editorExtensionId, ...) , but in this case I can only reply once, as there's no port with a longer lifetime.

Inside the extension - in background.js - I'm using chrome.runtime.onMessageExternal.addListener. Strangely, I usually get another error message after the first one: Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

The page is hosted on http://host.local in both cases.

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