diff --git a/platform/chromium/vapi-common.js b/platform/chromium/vapi-common.js index 9fcffc852..e04b5d779 100644 --- a/platform/chromium/vapi-common.js +++ b/platform/chromium/vapi-common.js @@ -73,6 +73,12 @@ vAPI.download = function(details) { /******************************************************************************/ +vAPI.insertHTML = function(node, html) { + node.innerHTML = html; +}; + +/******************************************************************************/ + vAPI.getURL = chrome.runtime.getURL; /******************************************************************************/ diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 5c3fb84cf..d64c3fd06 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -42,7 +42,7 @@ vAPI.firefox = true; // TODO: read these data from somewhere... vAPI.app = { name: 'µBlock', - version: '0.8.5.0' + version: '0.8.5.3' }; /******************************************************************************/ @@ -59,7 +59,7 @@ vAPI.app.restart = function() { // List of things that needs to be destroyed when disabling the extension // Only functions should be added to it -cleanupTasks = []; +var cleanupTasks = []; /******************************************************************************/ @@ -1212,8 +1212,9 @@ vAPI.toolbarButton.onBeforeCreated = function(doc) { var resizePopup = function() { var body = iframe.contentDocument.body; panel.parentNode.style.maxWidth = 'none'; - panel.style.width = iframe.style.width = body.clientWidth + 'px'; + // 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; }; var onPopupReady = function() { diff --git a/platform/firefox/vapi-common.js b/platform/firefox/vapi-common.js index 14dbbe37c..5fc3754ba 100644 --- a/platform/firefox/vapi-common.js +++ b/platform/firefox/vapi-common.js @@ -70,6 +70,28 @@ vAPI.download = function(details) { /******************************************************************************/ +vAPI.insertHTML = (function() { + const {classes: Cc, interfaces: Ci} = Components; + const parser = Cc['@mozilla.org/parserutils;1'].getService(Ci.nsIParserUtils); + const io = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService); + + return function(node, html) { + while ( node.firstChild ) { + node.removeChild(node.firstChild); + } + + node.appendChild(parser.parseFragment( + html, + parser.SanitizerAllowStyle, + false, + io.newURI(document.baseURI, null, null), + document.documentElement + )); + }; +})(); + +/******************************************************************************/ + vAPI.getURL = function(path) { return 'chrome://' + location.host + '/content/' + path.replace(/^\/+/, ''); }; diff --git a/platform/firefox/vapi-popup.js b/platform/firefox/vapi-popup.js new file mode 100644 index 000000000..73250bb2c --- /dev/null +++ b/platform/firefox/vapi-popup.js @@ -0,0 +1 @@ +/* Firefox: no platform-specific code */ \ No newline at end of file diff --git a/platform/safari/vapi-common.js b/platform/safari/vapi-common.js index 36690cd3c..dbf0fcdc9 100644 --- a/platform/safari/vapi-common.js +++ b/platform/safari/vapi-common.js @@ -68,6 +68,12 @@ vAPI.download = function(details) { /******************************************************************************/ +vAPI.insertHTML = function(node, html) { + node.innerHTML = html; +}; + +/******************************************************************************/ + vAPI.getURL = function(path) { return safari.extension.baseURI + path; }; diff --git a/src/devtool-log.html b/src/devtool-log.html index c8ff57219..3b6ecd885 100644 --- a/src/devtool-log.html +++ b/src/devtool-log.html @@ -13,6 +13,7 @@