Click the block button ( ) " +
"next to a hit title to block results from that site. A regular blocked hit becomes a one-line notation, " +
"while a Perma-ban disappears completely.
";
document.body.appendChild(mfd);
fixShowHideBtn();
fixuistyle();
fixaddpos();
fixaggblock();
fixajaxstyle();
fixpanepersist();
fix1clickstyle();
fixBeta();
document.getElementById("ghhts1").addEventListener("click",togglelist,true); // tabs
document.getElementById("ghhts2").addEventListener("click",togglelist,true);
document.getElementById("ghhts3").addEventListener("click",togglelist,true);
document.getElementById("ghhts4").addEventListener("click",togglelist,true);
document.getElementById("chkshownotc").addEventListener("change",updtpref,true); // home
document.getElementById("chk1click").addEventListener("change",updt1click,true);
document.getElementById("ghhsitelist").addEventListener("click",togglesite,true); // block
document.getElementById("ghhpbanlist").addEventListener("click",togglesite,true); // pban
document.getElementById("addradios").addEventListener("change",updtaddpos,true); // options
document.getElementById("aggressrads").addEventListener("change",updtaggress,true);
document.getElementById("chkajax").addEventListener("change",updtAJAX,true);
document.getElementById("chkdom4").addEventListener("change",updtAJAX,true);
document.getElementById("chkmpopen").addEventListener("change",updtpersist,true);
document.getElementById("chk1pban").addEventListener("change",updt1click,true);
document.getElementById("chkbeta").addEventListener("change",updtBeta,true);
document.getElementById("btnradios").addEventListener("change",updtuistyle,true);
document.getElementById("ghhedit1").addEventListener("click",chgcaption,true);
document.getElementById("ghhedit2").addEventListener("click",chgcaption,true);
document.getElementById("ghhedit3").addEventListener("click",chgcaption,true);
document.getElementById("ghhmfr").addEventListener("click",resetTextStrings,true);
document.getElementById("ghhecsr").addEventListener("click",openCustomStyleBar,true);
document.getElementById("ghhmf1").addEventListener("click",saveedits,true); // buttons
document.getElementById("ghhmf2").addEventListener("click",ghhcloseform,true);
document.getElementById("ghhmf3").addEventListener("click",toggleListUtil,true);
document.getElementById("ghhmf4").addEventListener("click",exportlist,true);
document.getElementById("ghhmf5").addEventListener("click",sortlist,true);
document.getElementById("ghhmf6").addEventListener("click",dedup,true);
document.getElementById("ghhmf7").addEventListener("click",importlist,true);
document.getElementById("ghhmf8").addEventListener("click",addAllNow,true);
document.getElementById("ghhmf9").addEventListener("click",unwww,true);
// Add JS icon link
addBtnLink();
}
async function addBtnLink(){
var JSBTN = document.createElement("img");
JSBTN.setAttribute('alt', 'JS');
if (typeof GM.getResourceUrl === "undefined"){
JSBTN.src = GM_getResourceURL("mycon");
} else { /* asynchronous*/
JSBTN.src = await GM.getResourceUrl("mycon");
}
document.querySelector("#ghhmt1 a").textContent = "";
document.querySelector("#ghhmt1 a").appendChild(JSBTN);
}
function togglelist(e){ // Change tabs
if (typeof e === 'string'){
var tgtid = e;
} else {
e.target.blur();
if (e.target.className == "ghhCurTab") return;
tgtid = e.target.id;
}
var tabbtns = document.querySelectorAll("#ghhtstrip>button");
var k, tabnum;
for (k=0; k' + sarray[i].split(':')[0] + '';
} else {
pblist += '
' + sarray[i].split(':')[0] + '
';
}
}
ulB = document.getElementById("ghhsitelist");
while (ulB.firstChild) ulB.removeChild(ulB.firstChild);
ulB.insertAdjacentHTML('beforeend', slist);
ulP = document.getElementById("ghhpbanlist");
while (ulP.firstChild) ulP.removeChild(ulP.firstChild);
ulP.insertAdjacentHTML('beforeend', pblist);
needupdate = false;
}
async function updtaddpos(e){ // Implement change for radio buttons re where to add to list
var rads = e.target.parentNode.querySelectorAll("input[type='radio']");
for (var i=0; i 0) {
if (confirm("You have unsaved changes to your lists. Save changes and sort, or cancel sorting?")){
saveedits(null);
} else {
fixaddpos();
return;
}
}
sortlist(null);
} else {
fixaddpos();
return;
}
}
addAt = rads[i].value;
ghhPrefO.addtolistpos[0] = addAt;
if (!GM4){
GM_setValue("ghhprefs", JSON.stringify(ghhPrefO));
} else {
await GM.setValue("ghhprefs", JSON.stringify(ghhPrefO));
}
break;
}
}
fixaddpos();
}
function fixaddpos(){ // Check appropriate radio button re where to add to list
var rads = document.getElementById("addradios").querySelectorAll("input[type='radio']");
for (var i=0; i 0 && input != txts[key][0]){
txts[key][0] = input.replace(/\"/g,"''");
btn.appendChild(document.createTextNode(txts[key][0]));
btn.removeChild(btn.firstChild);
if (!GM4){
GM_setValue("textstrings", JSON.stringify(txts));
} else {
await GM.setValue("textstrings", JSON.stringify(txts));
}
}
}
async function resetTextStrings(e){ // Reset buttons captions to defaults
if (confirm("Restore default button captions?")){
txts = defaultTxts;
if (!GM4){
GM_setValue("textstrings", JSON.stringify(txts));
} else {
await GM.setValue("textstrings", JSON.stringify(txts));
}
alert("Please reload to see the changes.");
e.target.blur();
}
}
async function exportlist(e){ // Display and populate export form, clean up from any prior use
if (!document.getElementById("ghhexport")) insertExportForm();
var expDiv = document.getElementById("ghhexport");
document.getElementById("ghheximhead").innerHTML = "Export Block List";
document.getElementById("ghheximinfo1").innerHTML = "These boxes display your current block list. " +
"
" +
"On the left, you have the list in its native format. By saving this format, you can preserve your regular/Perma-ban " +
"block decisions.
On the right, you have a simple list of domains. " +
"This would be a good format for sharing your list with others.";
if (!GM4){
var currlist = GM_getValue("hideyhosts");
} else {
currlist = await GM.getValue("hideyhosts");
}
document.getElementById("ghhtaleft").value = currlist;
var domList = currlist.substr(1).replace(/:[tp]\|/g, "\n");
document.getElementById("ghhtaright").value = domList.replace(/\n*$/, "");
if (!GM4){
var preimpolist = GM_getValue("hideyback", "");
} else {
preimpolist = await GM.getValue("hideyback", "");
}
if (preimpolist.length > 0){
document.getElementById("expgotopreimp").addEventListener("click",exportoldlist,true);
document.getElementById("expgotopreimp").style.display = "";
}
document.getElementById("ghhleftcontrols").style.display = "none";
document.getElementById("ghhrightcontrols").style.display = "none";
document.getElementById("ghhtbldiv").style.display = "none";
if (document.getElementById("ghhtaright").style.display == "none") document.getElementById("ghhtaright").style.display = "";
expDiv.style.display = "block";
e.target.blur();
}
function insertExportForm(){
var dNew, btn, par, ta;
dNew = document.createElement("div");
dNew.id = "ghhexport";
dNew.className = "ghhpane";
dNew.setAttribute("style","position:fixed;top:10px;left:5%;width:90%;z-index:10000;background:#ddd;padding:1em;font-size:1.25em;display:none;max-height:90vh;overflow-y:auto;");
dNew.innerHTML = '' +
'' +
'' +
'
' +
'
' +
'
' +
' ' +
'
Please review the above list for accuracy. If correct, add domains to: ' +
' ' +
' ' +
' ' +
' Replace entire blocklist:
';
document.body.appendChild(dNew);
document.getElementById('exportclose').addEventListener('click', function(){document.getElementById('ghhexport').style.display = 'none';}, true);
}
function importlist(e){ // Display import form, clean up from any prior use
if (!document.getElementById("ghhexport")) insertExportForm();
var expDiv = document.getElementById("ghhexport");
document.getElementById("ghheximhead").innerHTML = 'Import Block List';
document.getElementById("ghheximinfo1").innerHTML = "As a precaution in case something goes wrong, please use the " +
"feature to copy and save your current list as a backup.
" +
"To begin, paste your list into the left box below. Then click the Parse List for Import button. This script can import a list in its own native format, or a plain list of domains with a separate domain on each line, or " +
"separated by spaces. (It also converts the Noise Reduction for Google and Google Domain Blocker formats.)";
document.getElementById("ghhtaleft").value = "";
document.getElementById("ghhleftcontrols").style.display = "";
document.getElementById("ghhrightcontrols").style.display = "none";
document.getElementById("ghhexp1").addEventListener("click",parseList,true);
document.getElementById("impgotoexp").addEventListener("click",exportlist,true);
document.getElementById("ghhtaright").style.display = "none";
document.getElementById("ghhtbldiv").style.display = "none";
document.getElementById("chkimporepl").checked = false;
expDiv.style.display = "block";
e.target.blur();
}
function parseList(e){ // Parse putative domain list and redisplay cleaned up
var txt, sites = [], bHasTypes = 0, i, tbod, thd, rasis, lbpos, rbpos;
txt = document.getElementById("ghhtaleft").value;
if (txt.length < 4){
alert("Block list too short!");
return;
}
document.getElementById("ghhtbldiv").innerHTML = "";
// clean up/convert domain list to pipe-delimited
txt = txt.replace(/(http|https):/g, "");
txt = txt.replace(/(,|\/|;)/g, "|");
txt = txt.replace(/\s+/g, "|");
txt = txt.replace(/\|+/g, "|");
txt = txt.replace(/[\<\>"'=#\!\u2018\u2019\(\)\{\}]/g, "");
// strip regex
txt = txt.replace(/(\+|\*|\$|\\)/g, "");
while (txt.indexOf("[") > -1 && txt.indexOf("]") > -1){
lbpos = txt.indexOf("[");
rbpos = txt.indexOf("]");
if (lbpos > 0 && rbpos + 1 < txt.length) txt = txt.substring(0,lbpos) + txt.substring(rbpos+1);
else {
if (lbpos == 0 && rbpos + 1 < txt.length) txt = txt.substring(rbpos+1);
else break; // for some reason, entire list is bracketed??
}
}
if (txt.indexOf(":") > -1) bHasTypes = 1;
sites = txt.split("|");
for (i=0; i 1){
if (sites[i].indexOf(".") == 0) sites[i] = sites[i].substr(1);
if (sites[i].indexOf("?") > -1) sites[i] = sites[i].substr(0,sites[i].indexOf("?"));
if (bHasTypes == 1){
if (sites[i].indexOf(":t") == sites[i].length - 2 || sites[i].indexOf(":p") == sites[i].length - 2){
sites[i] = "
";
document.getElementById("ghhtbldiv").style.display = "";
rasis = document.getElementById("ghhrightcontrols").querySelectorAll("input[value='asis']")[0];
if (bHasTypes == 1){
if (rasis.hasAttribute("disabled")) rasis.removeAttribute("disabled");
rasis.checked = true;
rasis.parentNode.style.color = "";
} else {
rasis.setAttribute("disabled","disabled");
rasis.parentNode.style.color = "rgb(172, 168, 153)";
document.getElementById("ghhrightcontrols").querySelectorAll("input[value='t']")[0].checked = true;
}
document.getElementById("ghhrightcontrols").style.display = "block";
document.getElementById("ghhexp2").addEventListener("click",doImport,true);
e.target.blur();
}
async function doImport(e){ // Add sites from cleaned up domain list to script block lists
var tbl, rads, i, typeRule, rows, dom, newDoms = "";
tbl = document.getElementById("ghhparsed");
if (!tbl){
alert("Unable to locate table of parsed domains!");
return;
}
if (tbl.parentNode.style.display == "none"){
alert("Please start the import process again!");
return;
}
rads = document.getElementById("ghhrightcontrols").querySelectorAll("input[type='radio']");
for (i=0; i 0){
switch (typeRule){
case "asis":
if (rows[i].children[1].textContent == "Perma-ban") newDoms += dom + ":p|";
else newDoms += dom + ":t|";
break;
default:
newDoms += dom + ":" + typeRule + "|";
}
rows[i].style.backgroundColor = "#ff0";
} else {
rows[i].style.backgroundColor = "#f00";
}
}
if (newDoms != ""){
// Back up current block list
if (!GM4){
GM_setValue("hideyback", blist);
} else {
await GM.setValue("hideyback", blist);
}
if (document.getElementById("chkimporepl").checked == true){
if (confirm("Delete current block list and replace it with domains you are importing? (To add to the current block list, click Cancel.)")) {
blist = "";
}
}
if (blist == "") blist = "|" + newDoms;
else blist += newDoms;
// Persist updated block list
if (!GM4){
GM_setValue("hideyhosts", blist);
} else {
await GM.setValue("hideyhosts", blist);
}
if(document.getElementById("ghhmngform").style.display=="block") refreshSiteList();
hidehits(null,true);
}
alert("Import of yellow-highlighted domains completed. Please check the Management Pane to " +
"view, sort, and/or de-duplicate your imported domains.");
}
async function exportoldlist(e){ // Display and populate export form with pre-import list
if (!document.getElementById("ghhexport")) insertExportForm();
var expDiv = document.getElementById("ghhexport");
document.getElementById("ghheximhead").innerHTML = "Export Old (Pre-Import) Block List";
document.getElementById("ghheximinfo1").innerHTML = "These boxes display your old block list from before the last import. " +
"
" +
"On the left, you have the list in its native format. By saving this format, you can preserve your regular/Perma-ban " +
"block decisions.
On the right, you have a simple list of domains. " +
"This would be a good format for sharing your list with others.";
if (!GM4){
var preimpolist = GM_getValue("hideyback", "");
} else {
preimpolist = await GM.getValue("hideyback", "");
}
document.getElementById("ghhtaleft").value = preimpolist;
var domList = preimpolist.substr(1).replace(/:[tp]\|/g, "\n");
document.getElementById("ghhtaright").value = domList.replace(/\n*$/, "");
document.getElementById("expgotoblist").addEventListener("click",exportlist,true);
document.getElementById("ghhleftcontrols").style.display = "none";
document.getElementById("ghhrightcontrols").style.display = "none";
document.getElementById("ghhtbldiv").style.display = "none";
if (document.getElementById("ghhtaright").style.display == "none") document.getElementById("ghhtaright").style.display = "";
expDiv.style.display = "block";
e.target.blur();
}
async function sortlist(e){ // Alpha-sort block list
if (listchgs > 0) {
if (confirm("You have unsaved changes to your lists. Save changes and sort, or cancel sorting?")){
saveedits(null);
} else {
return;
}
}
if (blist.substr(0,1) != "|") blist = "|" + blist;
var sarray = blist.substr(1,blist.length-2).split("|");
sarray.sort();
// Persist sorted list
if (!GM4){
GM_setValue("hideyhosts", "|" + sarray.join("|") + "|");
blist = GM_getValue("hideyhosts");
} else {
await GM.setValue("hideyhosts", "|" + sarray.join("|") + "|");
blist = await GM.getValue("hideyhosts");
}
refreshSiteList();
if (e) e.target.blur();
}
async function dedup(e){ // De-duplicate block lists
if (!confirm("If you block example.com, you don't also need to block www.example.com. Remove unnecessary domains from the block list?")) return;
var barray, i, j, iadd, smain, stest, sremd = "", sques = "";
if (blist.substr(0,1) != "|") blist = "|" + blist;
barray = blist.substr(1,blist.length-2).split("|");
for (i=0; i -1){
barray[i] = barray[i].substr(0,barray[i].indexOf(":")).split(".").reverse().join(".") + "!t";
} else {
if (barray[i].indexOf(":p") > -1){
barray[i] = barray[i].substr(0,barray[i].indexOf(":")).split(".").reverse().join(".") + "!p";
} else {
barray[i] = barray[i].split(".").reverse().join(".") + "!t";
}
}
}
barray.sort();
for (i=0; i 0) ghhPrefO.shownotc[0] = tmp;
GM_deleteValue("shownotc");
}
tmp = GM_getValue("mngpaneopen");
if (tmp){
if (tmp.length > 0) ghhPrefO.mngpaneopen[0] = tmp;
GM_deleteValue("mngpaneopen");
}
tmp = GM_getValue("mngbtnstyle");
if (tmp){if (tmp.length > 0){
if (tmp.indexOf("-")>-1) tmp = "both"; // default ancient pref
ghhPrefO.mngbtnstyle[0] = tmp;
GM_deleteValue("mngbtnstyle");
}}
tmp = GM_getValue("addtolistpos");
if (tmp){
if (tmp.length > 0) ghhPrefO.addtolistpos[0] = tmp;
GM_deleteValue("addtolistpos");
}
tmp = GM_getValue("aggressiveblock");
if (tmp){
if (tmp.length > 0) ghhPrefO.aggressiveblock[0] = tmp;
GM_deleteValue("aggressiveblock");
}
tmp = GM_getValue("usemutation");
if (tmp){
if (tmp.length > 0) ghhPrefO.usemutation[0] = tmp;
GM_deleteValue("usemutation");
}
} else {
if (ghhPrefs.indexOf("reserved1")>-1){
var oldPrefs = JSON.parse(ghhPrefs);
ghhPrefO.shownotc[0] = oldPrefs.shownotc[0];
ghhPrefO.mngpaneopen[0] = oldPrefs.mngpaneopen[0];
ghhPrefO.mngbtnstyle[0] = oldPrefs.mngbtnstyle[0];
ghhPrefO.addtolistpos[0] = oldPrefs.addtolistpos[0];
ghhPrefO.aggressiveblock[0] = oldPrefs.aggressiveblock[0];
ghhPrefO.usemutation[0] = oldPrefs.usemutation[0];
ghhPrefO.oneclick[0] = oldPrefs.oneclick[0];
}
}
GM_setValue("ghhprefs", JSON.stringify(ghhPrefO)); // requires Fx 3.5+
}
function togglebbtn(e){
var bbtn = e.currentTarget.querySelector('.ghhb');
if (bbtn){
if (e.type == "mouseover") bbtn.style.visibility = "";
else bbtn.style.visibility = "hidden";
}
}
function reQuery(e){
var ss, rads, i;
if (e){
if (e.target.id == "ghhbf5") ss = "+site:";
else ss = "+-site:";
rads = e.target.form.querySelectorAll('input[type="radio"]');
} else {
ss = "+-site:"; // ALT omit
rads = document.querySelector('#ghhblockform form').querySelectorAll('input[type="radio"]');
}
if (rads.length > 0){
for (i=0; i-1 || q.indexOf(d+"&")>-1)) return; // try to block dups, may be overinclusive
var qa = q.split("&");
var has_q = false;
for (var j=qa.length-1; j>=0; j--){
if (qa[j].split("=")[0] == "q"){
qa[j] += d;
has_q = true;
break;
} else {
if (qa[j].indexOf("#q=") > -1){
qa[j] += d;
has_q = true;
break;
}
}
}
if (has_q) window.location.href = window.location.href.substr(0, window.location.href.indexOf("?")+1) + qa.join("&");
else console.log("LOG:Unable to add new search term to URL");
}
function toggleciteline(posit) {
var ghhbd_sty = document.getElementById("bbposciteline");
if (posit == "C"){
if (!ghhbd_sty){
ghhbd_sty = document.createElement("style");
ghhbd_sty.id = "bbposciteline";
ghhbd_sty.setAttribute("type", "text/css");
document.body.appendChild(ghhbd_sty);
}
// "inline" the action menu
ghhbd_sty.appendChild(document.createTextNode(".action-menu {vertical-align:baseline !important;} .action-menu .clickable-dropdown-arrow, .action-menu .ab_button, .action-menu > a {display:none !important;} .action-menu-panel, .action-menu-panel ul, .action-menu-panel ol, .action-menu-item {display:inline !important; visibility: visible !important; border:none !important; box-shadow:none !important; background-color:transparent !important; margin:0 !important; padding:0 !important; top:0 !important; height:auto !important; line-height:auto !important;} .action-menu-item a.fl, .action-menu-button {padding:0 0 0 6px !important; display:inline !important;} .action-menu-panel {position:static;} .action-menu-item a.fl:hover {text-decoration:underline !important;} .action-menu + .crc {margin-right: 9px !important;} .action-menu + .crc ._Bs {margin-left: 1px !important;}"));
// restyle the block button
ghhbd_sty.appendChild(document.createTextNode(".ghhb {border:none!important; text-decoration:none!important; font-size:1em!important; color:#333!important; padding:0!important; margin-left:8px!important;} .ghhb:hover {background:transparent!important; text-decoration:underline !important;}"));
} else { // remove citeline rules
if (ghhbd_sty){
while(ghhbd_sty.firstChild) ghhbd_sty.removeChild(ghhbd_sty.firstChild);
}
}
}
function openCustomStyleBar(e){
// Create fixed div with text input and buttons: Save, Test, Close
var csb = document.getElementById("ghhcsb");
if (csb){
csb.style.display = "block";
} else {
csb = document.createElement("div");
csb.id = "ghhcsb";
csb.setAttribute("style","position:fixed;bottom:0;left:0;z-index:750;width:100%;background-color:#afa;");
csb.innerHTML = "";
document.body.appendChild(csb);
document.getElementById("ghhcsb1").addEventListener("click",saveCustomStyle,true);
document.getElementById("ghhcsb2").addEventListener("click",testCustomStyle,true);
document.getElementById("ghhcsb3").addEventListener("click",closeCustomStyleBar,true);
}
document.getElementById("ghhcsbrule").value = custSty;
}
async function saveCustomStyle(e){
// Update preferences and apply change to style#ghhbdcuststy
custSty = document.getElementById("ghhcsbrule").value;
if (!GM4){
GM_setValue("hiderStyles", custSty);
} else {
await GM.setValue("hiderStyles", custSty);
}
injectCustom();
document.getElementById("ghhbdcuststy").innerHTML = "";
document.getElementById("ghhbdcuststy").appendChild(document.createTextNode(custSty));
}
function testCustomStyle(e){
// Add/Edit style#ghhbdcuststy
injectCustom();
document.getElementById("ghhbdcuststy").innerHTML = "";
document.getElementById("ghhbdcuststy").appendChild(document.createTextNode(document.getElementById("ghhcsbrule").value));
}
function closeCustomStyleBar(e){
// Turn off display and reapply saved style to style#ghhbdcuststy
document.getElementById("ghhcsb").style.display = "none";
injectCustom();
document.getElementById("ghhbdcuststy").innerHTML = "";
document.getElementById("ghhbdcuststy").appendChild(document.createTextNode(custSty));
}
function removePBs(e){ // GoogleMonkeyR layout only
// Schedule Permaban removal (prevent simultaneous/conflicting runs)
var PBsBlanks = document.querySelectorAll("table#GTR li[blockhidden], table#GTR div.g[blockhidden], table#GTR td:empty");
if (PBsBlanks.length < 1) return;
if (t_pb) window.clearTimeout(t_pb);
t_pb = window.setTimeout(GMRshuffle, 100);
}
function GMRshuffle(){ // GoogleMonkeyR layout only
// Delete Permaban hits
var PBs = document.querySelectorAll("table#GTR li[blockhidden], table#GTR div.g[blockhidden]");
if (PBs.length > 0){
for (var i=PBs.length; i>0; i--) PBs[i-1].remove();
}
// Check entire table for empty cells and shuffle contents
var tbl, row, cell, empties;
tbl = document.getElementById("GTR");
for (row=0; row 0 && empties < tbl.rows[row].cells.length){
for (cell=0; cell 0) tgt.appendChild(src.childNodes[0]);
}
function getNextCell(aCell, blnNonEmpty){
var startcell = aCell;
var retcell;
var i=0;
while (i<1000) {
if (startcell.nextElementSibling){ // not the last cell in the row
retcell = startcell.nextElementSibling;
} else {
if (startcell.parentNode.nextElementSibling){ // last cell in row and there's another row
retcell = startcell.parentNode.nextElementSibling.cells[0];
} else {
return null; // end of table
}
}
if (!retcell){
return null; // corrupted table structure
}
if (blnNonEmpty){
if (retcell.querySelector("li")){
return retcell;
} else {
startcell = retcell;
}
} else {
return retcell;
}
i++;
}
}
// "Add All" feature 2.0.9
async function addAllNow(e){
var unb = document.querySelectorAll('[ghhresult="unset"][ghhhost]'), dom = '', pdom = '', domlist = '';
for (var i=0; i -1 && patIPv4.test(dom) != true){
switch (bAggress){
case 'all':
dom = pdom; break;
case 'www':
if (dom.substr(0,3) == 'www') dom = pdom; break;
default:
// default to full domain
}
}
// Add dom to doms arrray (avoiding duplicates)
if (doms.includes(dom) !== true) doms.push(dom);
}
// Add new domains to the currently displayed block list
if (document.querySelector('button.ghhCurTab').id == 'ghhts3'){ // pban
domlist = doms.join(':p|') + ':p';
} else { // regular
domlist = doms.join(':t|') + ':t';
}
if (blist.substr(0,1) != '|') blist = '|' + blist;
if (addAt == 'end') blist += domlist + '|';
else blist = '|' + domlist + blist;
needupdate = true;
// Store the list
if (!GM4){
GM_setValue('hideyhosts', blist);
} else {
await GM.setValue('hideyhosts', blist);
}
// Apply the change to the results
hidehits(null,true);
if (document.getElementById('GTR')) removePBs();
// Update the dialog
if (addAt == 'sort') sortlist(null);
refreshSiteList();
}