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

392
Vistas
"chrome.runtime.reload is not a function" when trying to livereload my extension runtime

I am building a chrome extension, and have integrated it with livereload-js. It is working, except that the call to chrome.runtime.reload() throws an error that the function reload doesn't exist on the chrome.runtime. This is weird, since the documentation says that this method should be there and when I read the the docs for the reload method it says that this method should be available without any additional permissions needed. If this was removed in Manifest version 3, it hasn't been explained in the docs.

To simplify I have removed most of the code from the app, and am simply trying to get the livereload to work. Here is my manifest.json:

{
    "name": "Cool AF",
    "description": "something cool",
    "version": "1.1",
    "manifest_version": 3,
    "background": {
        "service_worker": "background.js"
    },
    "content_scripts": [
        {
            "matches": ["https://nevermind/*"],
            "css": ["main.css"],
            "js": ["main.js", "livereload.js"]
        }
    ],
    "host_permissions": ["http://localhost:35729/"],
    "permissions": ["storage", "management", "activeTab", "alarms", "background"]
}

The code in livereload.js considers if it is a chrome extension and calls chrome.runtime.reload(), which throws an error. I have removed all other code from the extension besides a console.log that let's me know the extension is loading. Any ideas on how to get the reload function to appear on the chrome.runtime object?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

chrome.runtime.reload isn't available for content scripts.

See documentation for the list of methods available to content scripts; some chrome.runtime methods are, but not all:

runtime:

  • connect
  • getManifest
  • getURL
  • id
  • onConnect
  • onMessage
  • sendMessage

The idiomatic way is to message your background script to request it to perform an operation content scripts aren't allowed to do.

about 4 years ago · Juan Pablo Isaza 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