diff --git a/src/js/document-blocked.js b/src/js/document-blocked.js
index 6657a027f..09a76e257 100644
--- a/src/js/document-blocked.js
+++ b/src/js/document-blocked.js
@@ -1,7 +1,7 @@
/*******************************************************************************
- uBlock - a browser extension to block requests.
- Copyright (C) 2015 Raymond Hill
+ uBlock Origin - a browser extension to block requests.
+ Copyright (C) 2015-present Raymond Hill
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -59,25 +59,21 @@ var details = {};
if ( Array.isArray(lists) === false || lists.length === 0 ) {
return;
}
- var parent = uDom.nodeFromSelector('#whyex > span:nth-of-type(2)');
- var separator = '';
- var entry, url, node;
- for ( var i = 0; i < lists.length; i++ ) {
- entry = lists[i];
- if ( separator !== '' ) {
- parent.appendChild(document.createTextNode(separator));
+ let parent = uDom.nodeFromSelector('#whyex > span:nth-of-type(2)');
+ for ( let i = 0; i < lists.length; i++ ) {
+ let entry = lists[i];
+ let elem = document.querySelector('#templates .filterList').cloneNode(true);
+ let source = elem.querySelector('.filterListSource');
+ source.href = 'asset-viewer.html?url=' + entry.assetKey;
+ source.textContent = entry.title;
+ if (
+ typeof entry.supportURL === 'string' &&
+ entry.supportURL !== ''
+ ) {
+ elem.querySelector('.filterListSupport')
+ .setAttribute('href', entry.supportURL);
}
- url = entry.supportURL;
- if ( typeof url === 'string' && url !== '' ) {
- node = document.createElement('a');
- node.textContent = entry.title;
- node.setAttribute('href', url);
- node.setAttribute('target', '_blank');
- } else {
- node = document.createTextNode(entry.title);
- }
- parent.appendChild(node);
- separator = ' \u2022 ';
+ parent.appendChild(elem);
}
uDom.nodeFromId('whyex').style.removeProperty('display');
};
@@ -146,7 +142,7 @@ var proceedPermanent = function() {
if ( matches === null ) {
return;
}
- var proceed = uDom('#proceedTemplate').clone();
+ var proceed = uDom('#templates .proceed').clone();
proceed.descendants('span:nth-of-type(1)').text(matches[1]);
proceed.descendants('span:nth-of-type(4)').text(matches[2]);
diff --git a/src/js/reverselookup-worker.js b/src/js/reverselookup-worker.js
index 3a9b96e27..5df97745f 100644
--- a/src/js/reverselookup-worker.js
+++ b/src/js/reverselookup-worker.js
@@ -1,7 +1,7 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
- Copyright (C) 2015-2017 Raymond Hill
+ Copyright (C) 2015-present Raymond Hill
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -51,21 +51,20 @@ var extractBlocks = function(content, begId, endId) {
var fromNetFilter = function(details) {
var lists = [],
- compiledFilter = details.compiledFilter,
- entry, content, pos, notFound;
+ compiledFilter = details.compiledFilter;
- for ( var assetKey in listEntries ) {
- entry = listEntries[assetKey];
+ for ( let assetKey in listEntries ) {
+ let entry = listEntries[assetKey];
if ( entry === undefined ) { continue; }
- content = extractBlocks(entry.content, 0, 1000);
- pos = 0;
+ let content = extractBlocks(entry.content, 0, 1000);
+ let pos = 0;
for (;;) {
pos = content.indexOf(compiledFilter, pos);
if ( pos === -1 ) { break; }
// We need an exact match.
// https://github.com/gorhill/uBlock/issues/1392
// https://github.com/gorhill/uBlock/issues/835
- notFound = pos !== 0 && content.charCodeAt(pos - 1) !== 0x0A;
+ let notFound = pos !== 0 && content.charCodeAt(pos - 1) !== 0x0A;
pos += compiledFilter.length;
if (
notFound ||
@@ -74,6 +73,7 @@ var fromNetFilter = function(details) {
continue;
}
lists.push({
+ assetKey: assetKey,
title: entry.title,
supportURL: entry.supportURL
});
@@ -81,7 +81,7 @@ var fromNetFilter = function(details) {
}
}
- var response = {};
+ let response = {};
response[details.rawFilter] = lists;
postMessage({
diff --git a/src/js/reverselookup.js b/src/js/reverselookup.js
index ebe73d56c..d407f853e 100644
--- a/src/js/reverselookup.js
+++ b/src/js/reverselookup.js
@@ -1,7 +1,7 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
- Copyright (C) 2015-2017 Raymond Hill
+ Copyright (C) 2015-present Raymond Hill
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by