I want to develop a chrome extension which docks a new panel to the bottom of current web page. The GUI should be something like Firebug or Developer tools.
I tried to inject an iframe to web page like this:
The iframe can be seen, but it covers the content of the main page.
How can I solve the problem? Hope someone can give me some suggestions or simple examples...
Answer:
Notice how
I tried to inject an iframe to web page like this:
$('body').append(
'<iframe src="'
+ chrome.extension.getURL('panel.html')
+ '" style="position: fixed; width: 100%; bottom: 0px; height: 300px; display: block;"></iframe>');
The iframe can be seen, but it covers the content of the main page.
How can I solve the problem? Hope someone can give me some suggestions or simple examples...
Answer:
function windowLoaded() {
alert('<html>' + document.documentElement.innerHTML + '</html>');
}
addEventListener("load", windowLoaded, false);
windowLoaded
is created before it is used, not after, which won't work.
Also notice how I am getting the innerHTML of
document.documentElement
, which is the html
tag, then adding the html
source tags around it.
No comments:
Post a Comment