Fix invalid support URL in document-blocked page

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1345
This commit is contained in:
Raymond Hill 2020-11-15 10:19:09 -05:00
parent 8362751be5
commit e360e90d1e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 16 additions and 18 deletions

View File

@ -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>
@ -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>

View File

@ -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');
})();