Safari extension modifying to an iframe within main page
Hi I've wrote simple Safari extension to display QR code with url to currently visiting website..This is part of code where I am appending the code to page..
document.body.insertBefore(qrdisplay, document.body.firstChild);
qrdisplay.appendChild(img);
All is wokring, but what sucks is, the code appends too to an iframe content..Actually nasty problem if every site contains facebook like box and lot of other crap:D Can I somehow append the element only to main body?When I would use some kind of "body child of body" selector it wouldnt work..It simply cant as there are two independent DOMs?Am I righ开发者_开发技巧t?
Thanks for your advice, I hope you understand to my problem..
I think you need to check if window === window.top
before running your appending code.
精彩评论