I'm currently have some issue with an iframe...
I have my iframe with a searchbox and i want to make this searchbox redirection when i click on go by creating a new tab/window
http://img51.imageshack.us/i/issuec.png/
So to be clear, my google chrome extension call as a content script : overlay.js Then this one will put at the end of the current page my "overlay.html" page.
So the problem come from that my .html is represented as a iframe and i don't see how i can redirect from this iframe.
overlay.html
<form id="searchForm" action="#" onsubmit="searchBoxRedirection(this)" method="post">
<img id="logo" src="images/extension.png" alt="Logo"></img>
<input type="search" value="" name="searching">
<input type="submit" value="Go !" />
</form>
overlay.js
var overlay= {
init: function() {
this.injectoverlay();
//alert('Initialisation reussie');
},
injectoverlay: function() {
var body = $('body'),
overlayURL = chrome.extension.getURL("overlay.html"),
iframe = $('<iframe id="YouroverlayFrame" src="'+overlayURL+'">');
body.append(iframe);
iframe.show();
//alert('Injection reussie');
}
}
Tool.js
function searchBoxRedirection(form)
{
tabs.create({url:"www.yahoo.fr"});
}
manifest.json
{
"background_page" : "background.html",
"browser_action" :
{
"default_icon" : "images/Extension.png"
},
"content_scripts":
[ {
"all_frames": true,
"css": ["css/overlay.css"],
"js": ["js/overlay.js"],
"matches": ["http://*/*"],
"run_at": "document_start"
} ],
"permissions" : ["tabs", "unlimitedStorage", "http://*/*"],
"name" : "MyOverlay",
"version" : "1.1",
"description" : "Sindar Overlay"
}