I am trying to append an iframe page to the page that user visits with a chrome extension. The iframe will be placed at the top of the page for example. I have succesfully managed to append the iframe with the following code (myscript.js):
var iframe = document.createElement("iframe");
iframe.src = chrome.extension.getURL("./myIframe.html");
document.body.insertBefore(iframe, document.body.firstChild);
Howevery, in my iframe page I am using a couple of javascripts (.js) that also require jquery (.js) lib. It seems that none of the scripts work making in this way the iframe page non-functional. In my content_scripts I include the lib:
"content_scripts": [
{
"matches" : ["http://*/*", "https://*/*"],
"js": ["jquery.js", "myscript.js"],
"all_frames" : true
}
],
I have also tried to include every (.js) file that the iframe uses but still didn't work. What I m actually trying to do is through an interface let the user to perform some actions on the page that sees like changing background colour. I m suspecting that performing some actions through iframe page's javascripts on the current page of user is not possible. Does anyone know what I need to do in order to fix this problem or if there is any other way to achieve what I m trying here? Thanks.