Skip to content

Instantly share code, notes, and snippets.

@jefflab
Created October 4, 2010 23:46
Show Gist options
  • Save jefflab/610671 to your computer and use it in GitHub Desktop.
Save jefflab/610671 to your computer and use it in GitHub Desktop.
// main.html
<frameset rows="50,*">
<frame src="nav_bar.html" />
<frame src="http://www.zoodles.com/" />
</frameset>
// background.html
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
if( sender.tab && request.url ) {
console.log( 'Document location is = ' + request.url );
sendResponse({is_blocked: false});
}
});
// content_script.html
chrome.extension.sendRequest({url: document.location}, function(response) {
console.log(response.is_blocked);
});
// manifest.json
{
...
"permissions": [
"tabs",
"*://*/*"
],
"content_scripts": [
{
...
"all_frames": true
}
]
}
// console output:
Unsafe JavaScript attempt to access frame with URL chrome-extension://<ID HERE>/app/main.html from frame with URL http://www.zoodles.com/parent/kids/5530/video_mail. Domains, protocols and ports must match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment