1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00
This commit is contained in:
gorhill 2015-02-12 09:24:45 -05:00
parent 36960f273b
commit 273dcd763f

View File

@ -1321,15 +1321,19 @@ vAPI.toolbarButton.onBeforeCreated = function(doc) {
return;
}
updateTimer = setTimeout(resizePopup, 20);
updateTimer = setTimeout(resizePopup, 10);
};
var resizePopup = function() {
updateTimer = null;
var body = iframe.contentDocument.body;
panel.parentNode.style.maxWidth = 'none';
// Set the hegiht first, then the width for proper resising
panel.style.height = iframe.style.height = body.clientHeight + 'px';
panel.style.width = iframe.style.width = body.clientWidth + 'px';
updateTimer = null;
// https://github.com/gorhill/uBlock/issues/730
// Voodoo programming: this recipe works
panel.style.height = iframe.style.height = body.clientHeight.toString() + 'px';
panel.style.width = iframe.style.width = body.clientWidth.toString() + 'px';
if ( iframe.clientHeight !== body.clientHeight || iframe.clientWidth !== body.clientWidth ) {
delayedResize();
}
};
var onPopupReady = function() {
var win = this.contentWindow;