javascript - Greasemonkey iframe content access jQuery -
i had wrong impression using greasemonkey allow me unrestricted access iframe's elements jquery selectors..
the html page example:
<html> <body> <div id='content'> //here first iframe <iframe src='bla.php'> <html> <body> <div id='content2'> //here iframe inserted <iframe src='bla2.php'> //here simple elements <div id="goal"> password secret </div> </iframe> </div> </body> <html> </iframe> </div> </body> <html>
so i'm trying find if #goal selector contains secret, , tried using
$('#goal').text().search('secret');
obviously doesn't work, tried getting whole dom variable , used variable.indexof('secret') .. after debugging, dom content not contain iframes contents.
any solution may use ? greasemonkey settings may apply ?. thank you.
iframes treated different, jquery has second optional argument, related used document dom, default document, , setting iframe document work.
$('#goal', frames[0][0].document ).text().search('secret');
Comments
Post a Comment