Skip to content

Commit

Permalink
Fix invalid support URL in document-blocked page
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Nov 15, 2020
1 parent 8362751 commit e360e90
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/document-blocked.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=yes">
<title></title>
<link rel="stylesheet" type="text/css" href="css/themes/default.css">
<link rel="stylesheet" href="css/common.css" type="text/css">
<link rel="stylesheet" href="css/fa-icons.css" type="text/css">
<link rel="stylesheet" type="text/css" href="css/document-blocked.css">
<link rel="stylesheet" href="css/themes/default.css">
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/fa-icons.css">
<link rel="stylesheet" href="css/document-blocked.css">
</head>
<body>
<div id="warningSign"><a class="fa-icon" href="https://github.com/gorhill/uBlock/wiki/Strict-blocking" target="_blank">exclamation-triangle</a></div>
<div id="warningSign"><a class="fa-icon" href="https://github.com/gorhill/uBlock/wiki/Strict-blocking" target="_blank" rel="noopener noreferrer">exclamation-triangle</a></div>

<div>
<p data-i18n="docblockedPrompt1"></p>
Expand Down Expand Up @@ -51,7 +51,7 @@
<span class="filterList">
<span class="filterListSeparator">&#x2022;</span>
<a class="filterListSource" href="asset-viewer.html?url=" target="_blank"></a>&nbsp;<!--
--><a class="fa filterListSupport" href="#" target="_blank">&#xf015;</a>
--><a class="fa-icon filterListSupport hidden" href="#" target="_blank" rel="noopener noreferrer">home</a>
</span>
</div>

Expand Down
22 changes: 10 additions & 12 deletions src/js/document-blocked.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,17 @@ let details = {};

const parent = uDom.nodeFromSelector('#whyex > span:nth-of-type(2)');
for ( const list of lists ) {
const elem = document.querySelector('#templates .filterList')
.cloneNode(true);
const source = elem.querySelector('.filterListSource');
source.href += encodeURIComponent(list.assetKey);
source.textContent = list.title;
if (
typeof list.supportURL === 'string' &&
list.supportURL !== ''
) {
elem.querySelector('.filterListSupport')
.setAttribute('href', list.supportURL);
const listElem = document.querySelector('#templates .filterList')
.cloneNode(true);
const sourceElem = listElem.querySelector('.filterListSource');
sourceElem.href += encodeURIComponent(list.assetKey);
sourceElem.textContent = list.title;
if ( typeof list.supportURL === 'string' && list.supportURL !== '' ) {
const supportElem = listElem.querySelector('.filterListSupport');
supportElem.setAttribute('href', list.supportURL);
supportElem.classList.remove('hidden');
}
parent.appendChild(elem);
parent.appendChild(listElem);
}
uDom.nodeFromId('whyex').style.removeProperty('display');
})();
Expand Down

0 comments on commit e360e90

Please sign in to comment.