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

309
Vistas
chrome extension content script setTimeout throws error Blocked a frame with origin "X" from accessing a cross-origin frame

Chrome extension content script.

I am loading Jquery in the content script as following (the jquery file is contained within the extension pacakge):

"content_scripts": [
    {
        "matches": [
            "http://*/*",
            "https://*/*"
        ],
        "js": ["lib/jquery-3.6.0.min.js", "content.js"],
        "run_at": "document_idle"
    }]

I then try to run the following code in the content script (content.js):

    setTimeout(() => {
       $("span").each((el) => {
           console.log("****", $(this).text());
       })
    }, 2000)

Which ends with chrome throwing the following error:

DOMException: Blocked a frame with origin "https://" from accessing a cross-origin frame.

The weird thing is that if I dont use $(this) there is no problem. so for example the following would work fine without errors:

setTimeout(() => {
    $("span").text("asdasdasd");
}, 2000)

What am I missing here? I dont get the reasoning behind this and its driving me mad...

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