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 Developer tools.
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…
So, with this you’re not adjusting the underlying page so that the bottom 300px of the page isn’t covered up from your panel. Here is some javascript to bump up the bottom of the page 300px:
Also, instead of just appending to the body like this:
$('body').append(, I suggest usingdocument.documentElementinstead ofbody, and even using vanilla javascript for something so basic, this would look like:I think this will solve your problem… not sure if your page has something unique that’s causing an error