Fix AB Title & Favicon

This commit is contained in:
Logan 2023-02-27 14:11:15 -05:00
parent c44622d9b0
commit 5dcb0e72c1

View file

@ -246,6 +246,31 @@ document.addEventListener("visibilitychange", handleTabLeave)
} }
}); });
let tryAbFavi = localStorage.getItem("ABfaviconURL");
let ABFavicon = "";
if (tryAbFavi === null) {
console.warn("ABfaviconURL is null, Defaulting");
ABFavicon = "";
} else if (tryAbFavi == "") {
console.warn("ABfaviconURL is empty, Defaulting");
ABFavicon = "";
} else {
ABFavicon = tryAbFavi;
}
let tryAbTitle = localStorage.getItem("ABtitle");
let ABTitle = "";
if (tryAbTitle === null) {
console.warn("ABtitle is null, Defaulting");
ABTitle = "";
} else if (tryAbTitle == "") {
console.warn("ABtitle is empty, Defaulting");
ABTitle = "";
} else {
ABTitle = tryAbTitle;
}
// Stealth engine, a dependency for everything above. // Stealth engine, a dependency for everything above.
function stealthEngine(encodedURL) { function stealthEngine(encodedURL) {
// Remember that the EncodedURL argument must be pre-encoded, or encoded before the function is called. // Remember that the EncodedURL argument must be pre-encoded, or encoded before the function is called.
@ -281,9 +306,8 @@ document.addEventListener("visibilitychange", handleTabLeave)
doc.head.appendChild(arcSrc); doc.head.appendChild(arcSrc);
const link = location.href; const link = location.href;
img.rel = "icon"; img.rel = "icon";
img.href = img.href = ABFavicon || "https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png";
"https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png"; doc.title = ABTitle || "Nebula";
doc.title = getRandomName();
var currentLink = link.slice(0, link.length - 1); var currentLink = link.slice(0, link.length - 1);
@ -295,6 +319,7 @@ document.addEventListener("visibilitychange", handleTabLeave)
style.width = style.height = "100%"; style.width = style.height = "100%";
doc.body.appendChild(iframe); doc.body.appendChild(iframe);
doc.head.appendChild(img);
} }
} }
}, 1500); }, 1500);
@ -672,30 +697,6 @@ function handleTabLeave() {
// Create and Add the event listener // Create and Add the event listener
document.addEventListener("visibilitychange", handleTabLeave); document.addEventListener("visibilitychange", handleTabLeave);
let tryAbFavi = localStorage.getItem('ABfaviconURL');
let ABFavicon = "";
if (tryAbFavi === null) {
console.warn("ABfaviconURL is null, Defaulting");
ABFavicon = "";
} else if (tryAbFavi == "") {
console.warn("ABfaviconURL is empty, Defaulting");
ABFavicon = "";
} else {
ABFavicon = tryAbFavi;
}
let tryAbTitle = localStorage.getItem('ABtitle');
let ABTitle = "";
if (tryAbTitle === null) {
console.warn("ABtitle is null, Defaulting");
ABTitle = "";
} else if (tryAbTitle == "") {
console.warn("ABtitle is empty, Defaulting");
ABTitle = "";
} else {
ABTitle = tryAbTitle;
}
const stealthStored = localStorage.getItem('nogg') const stealthStored = localStorage.getItem('nogg')
function link (_link) { function link (_link) {
if (stealthStored == 'on') { if (stealthStored == 'on') {
@ -711,15 +712,16 @@ function link (_link) {
if (!popup || popup.closed) { if (!popup || popup.closed) {
alert("Popups are disabled!"); alert("Popups are disabled!");
} else { } else {
const doc = popup.document const doc = popup.document;
const iframe = doc.createElement('iframe') const iframe = doc.createElement("iframe");
const style = iframe.style const style = iframe.style;
const img = doc.createElement('link') const img = doc.createElement("link");
const link = location.href const link = location.href;
img.rel = 'icon' img.rel = "icon";
img.href = ABFavicon img.href =
doc.title = ABTitle "https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png";
var currentLink = _link.slice(0, _link.length - 1) doc.title = getRandomName();
var currentLink = _link.slice(0, _link.length - 1);
iframe.src = iframe.src =
location.origin + location.origin +
"/service/go/" + "/service/go/" +
@ -729,7 +731,6 @@ function link (_link) {
style.border = style.outline = 'none' style.border = style.outline = 'none'
style.width = style.height = '100%' style.width = style.height = '100%'
doc.body.appendChild(iframe) doc.body.appendChild(iframe)
doc.head.appendChild(img)
} }
} }
}, 0200); }, 0200);