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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -