mirror of
https://github.com/QuiteAFancyEmerald/Holy-Unblocker.git
synced 2025-05-13 20:10:01 -04:00
Fixed event listener bug and added some commenting for hacky test case.
This commit is contained in:
parent
ad64639a75
commit
c31362c3f6
2 changed files with 9 additions and 4 deletions
3
test.js
3
test.js
|
@ -142,6 +142,7 @@ async function testCommonJSOnPage() {
|
|||
|
||||
if (window.goProx && window.goProx.ultraviolet) {
|
||||
try {
|
||||
// For the hacky URL test, keep this as example.com.
|
||||
const generatedUrl = window.goProx.ultraviolet(
|
||||
"example.com",
|
||||
false
|
||||
|
@ -149,6 +150,8 @@ async function testCommonJSOnPage() {
|
|||
console.log("Generated Ultraviolet URL:", generatedUrl);
|
||||
results[0].ultraviolet = generatedUrl ? generatedUrl : "failure";
|
||||
|
||||
// Test to see if the document title for example.com has loaded,
|
||||
// by appending an IFrame to the document and grabbing its content.
|
||||
const testGeneratedUrlHacky = async (url) => {
|
||||
let result = false;
|
||||
const exampleIFrame = document.createElement("iframe");
|
||||
|
|
|
@ -68,9 +68,10 @@ readCookie("HBHideAds").then(s => (s != "false") ? pageHideAds() : pageShowAds((
|
|||
if (document.getElementById("csel")) {
|
||||
|
||||
// Allow users to set a custom title with the UI.
|
||||
document.getElementById("titleform").addEventListener("submit", e => {
|
||||
let titleform = document.getElementById("titleform");
|
||||
titleform.addEventListener("submit", e => {
|
||||
e.preventDefault();
|
||||
e = this.firstElementChild;
|
||||
e = titleform.firstElementChild;
|
||||
if (e.value) {
|
||||
pageTitle(e.value);
|
||||
setCookie("HBTitle", e.value);
|
||||
|
@ -81,9 +82,10 @@ if (document.getElementById("csel")) {
|
|||
}, false);
|
||||
|
||||
// Allow users to set a custom favicon with the UI.
|
||||
document.getElementById("iconform").addEventListener("submit", e => {
|
||||
let iconform = document.getElementById("iconform");
|
||||
iconform.addEventListener("submit", e => {
|
||||
e.preventDefault();
|
||||
e = this.firstElementChild;
|
||||
e = iconform.firstElementChild;
|
||||
if (e.value) {
|
||||
pageIcon(e.value);
|
||||
setCookie("HBIcon", e.value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue