chrome extension inject in frameset code
i develop some extension for google grome i inject at document_end event my js (+jquery) i set in manifest allFrames: true my match url has frameset
my goal get element by id inside one of frame
i do
//wait for load my fram开发者_如何学运维e
$("frame[name='header']).load(function() {
//here I need get element by id inside this frame
});
how to do this properly?
PS: my frame is from the same domain
You dont need to do document load, I assume your doing this from a content script. Just place the "run_at" manifest to be document_end and within your content script you check if the current URL is that frame page, then you will be in that Domain.
Something like this:
if(location.href == 'http://someweb.com/path/to/page.html') {
var foo = document.getElementById('foo')
Something like that will get you started.
精彩评论