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

148
Vistas
Chrome addons (plugins) javascript files seem isolated

I have created an unpacked plugin for Chrome (that also works in Firefox), that has a single script.js file. And it works.

However, trying to call a function included in the addon's script.js file from the console results in:

Uncaught ReferenceError: _islet_convert is not defined
at <anonymous>:1:1

(anonymous) @ VM259:1

Which by the way I tested just to verify with not_a_function() in the console, and the error was the same.

Can someone tell me how Chrome and probably Firefox handles or isolates the JavaScript in the content_scripts files? And if there is any way to reference a function/method in the file.

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

0

From the documentation in Chrome:

https://developer.chrome.com/docs/extensions/mv2/content_scripts/

Content scripts live in an isolated world, allowing a content script to makes changes to its JavaScript environment without conflicting with the page or additional content scripts.

...

Isolated worlds do not allow for content scripts, the extension, and the web page to access any variables or functions created by the others. This also gives content scripts the ability to enable functionality that should not be accessible to the web page.

Essentially, it appears any communication needs to happen through the DOM including adding event listeners.

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