Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

98
Visualizações
Read an element within an iframe

I'm building an Edge extension. I'm trying to get the exact same element as this question asks, but I want to use JS, not Selenium. Element

I'm running the JS through my extension's background script. In the future, I would like the popup to have a button and that button to read the syllable on screen.

The provided solution is in Selenium and I'd like to transpile it into JS. driver.switch_to_frame(driver.find_element_by_xpath("//div[@class='game']/iframe[contains(@src,'jklm.fun')]"))

If none of this works, I guess I'll have to use optical text recognition.

Here's manifest.json

{
    "name": "myName",
    "description": "myDescription",
    "version": "1.0.0",
    "manifest_version": 3,
    "icons": {
        "128": "myIcon.png"
    },
    "content_scripts": [
        {
            "matches": [
                "https://jklm.fun/*"
            ],
            "js": [
                "js/myScript.js"
            ]
        }
    ]
}

Inside js folder, here's myScript.js

console.log('myscript is running')

const syllableHandler = () => { 
    const iframe = document.getElementsByTagName("iframe")
    console.log(iframe?.[0]?.contentWindow)
}

document.addEventListener('keydown', syllableHandler)

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda