From bcc1c0da11f161280b3d2d1cc607403368207a2e Mon Sep 17 00:00:00 2001 From: Deathamns Date: Tue, 13 Jan 2015 20:25:10 +0100 Subject: [PATCH] Fix prorblems caused by vAPI.insertHTML --- platform/firefox/vapi-common.js | 2 +- src/asset-viewer.html | 4 +++- src/js/3p-filters.js | 11 ++++++++++- src/popup.html | 6 +++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/platform/firefox/vapi-common.js b/platform/firefox/vapi-common.js index 5fc3754ba..1e9f81c92 100644 --- a/platform/firefox/vapi-common.js +++ b/platform/firefox/vapi-common.js @@ -77,7 +77,7 @@ vAPI.insertHTML = (function() { return function(node, html) { while ( node.firstChild ) { - node.removeChild(node.firstChild); + node.removeChild(node.firstChild); } node.appendChild(parser.parseFragment( diff --git a/src/asset-viewer.html b/src/asset-viewer.html index 88091255e..32b75f351 100644 --- a/src/asset-viewer.html +++ b/src/asset-viewer.html @@ -13,8 +13,10 @@
- + + + diff --git a/src/js/3p-filters.js b/src/js/3p-filters.js index c19a8e6da..6745fcd22 100644 --- a/src/js/3p-filters.js +++ b/src/js/3p-filters.js @@ -101,7 +101,7 @@ var renderBlacklists = function() { '
  • ', '', ' ', - '', + '', '{{name}}', '\u200E', '{{homeURL}}', @@ -237,6 +237,15 @@ var renderBlacklists = function() { uDom('#lists').html(html.join('')); uDom('a').attr('target', '_blank'); + // Firefox: sanitizer drops those `href` attributes that point to local URLs + var lis = uDom('a[data-href]'); + var a; + i = lis.length; + while ( i-- ) { + a = lis.subset(i, 1); + a.attr('href', a.attr('data-href')); + } + updateWidgets(); }; diff --git a/src/popup.html b/src/popup.html index 25e2172dd..6233f1610 100644 --- a/src/popup.html +++ b/src/popup.html @@ -8,7 +8,7 @@ µBlock - +
    @@ -38,8 +38,8 @@