Im working on an Addon which injects some HTML into the main page. But on sites with iframes, (Linkedin, Twitter, etc.) the HTML also ends up in the iframes. I was using
$('html').append(html);
I tried using attachTo: ["existing","top"]
but this appends the HTML only after reloading the page.
I also tried using
if (window.top === self) { $('html').append(html); } else { $(parent.document.body).append(html); }
This appends the HTML but i get an error permission denied to access property 'document'
Could someone guide me on how to append to the main page DOM without appending to iframes. Id be eternally grateful.