diff --git a/test.js b/test.js index e391bd49..601bb077 100644 --- a/test.js +++ b/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"); diff --git a/views/assets/js/csel.js b/views/assets/js/csel.js index a3678aea..a4c1089f 100644 --- a/views/assets/js/csel.js +++ b/views/assets/js/csel.js @@ -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);