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

186
Visualizações
Greasemonkey - locate in iFrame, click on parent?

I need to do a click on a page only if certain text is found in an iFrame of that page. The iFrame is a different domain.

I have this script:

// ==UserScript==
// @name         Click
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Click Login
// @match        https://www.example.net/
// @match        https://www.example.net/index.php
// @match        https://www.google.com/recaptcha/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant        none
// ==/UserScript==


var intv = setInterval(function() {

if (/(aria-checked="true")|(mediumheight)/i.test (document.body.innerHTML) ){

{

alert('Hello world!');

}

}

    }, 1000);

What this does is it finds aria-checked="true" and then displays the Hello World popup. But it all happens in the iFrame. And if I change the Hello World code to a code which does a click, the click will happen in the iFrame.

I would like aria-checked="true" to be located in the iFrame, but then the click to happen on the parent page (in this case, https://www.example.net)

Thanks

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