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