What do I need to change here so that the JavaScript code works with the manifest version 2 and the security policy?
Code:
function init()
{
chrome.tabs.getSelected(null, function(tab)
{
url = tab.url;
if(url.indexOf('chrome://') == -1 && url.indexOf('about:blank') == -1){
document.main.q.value = url;
}
});
}
I got it working after I put the JavaScript code from the HTML file into an own file and added the following to the manifest file: