From 178bded97f92795a87d6ea27df961be908215d72 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 12 Feb 2015 09:24:45 -0500 Subject: [PATCH] this fixes #730 --- platform/firefox/vapi-background.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index c2aef75..de216d1 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -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;