Created
October 4, 2010 23:46
-
-
Save jefflab/610671 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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