I am creating a chrome extension that needs to open a blank page and then depending upon some injected script open 1/2 iframes inside this blank window.
My issue is how do I open a blank window that I can inject and run JS from?
I have attempted this by opening a page with the url of about:blank
but I can not inject the script onto this page because of the following error:
chrome.tabs.create({
url: 'about:blank'
}, function(tab) {
chrome.tabs.executeScript(null, {
file: 'jquery/jquery.js'
}, function() {
console.log('done', arguments);
});
});
tabs.executeScript: Cannot access contents of url "about:blank".
Extension manifest must request permission to access this host.
Obviously this error message makes me think that I don't have permission to access this url and updated my manifest to allow access to all urls but I have the same issue.
"permissions": [
"tabs",
"*://*/*"
],
Extra Info
The reason why I am not opening a url directly is because I have 2 urls that I need to access one after the other. These files are upgrade scripts that I will need to see the results from.
The best way to do this would be to open a page and have an iframe of the left and right hand sides of the window that I can control using my injected script.