This commit is contained in:
QuiteAFancyEmerald 2024-07-10 18:46:32 -07:00
commit 8c4979f046
3 changed files with 32 additions and 4 deletions

28
test.js
View file

@ -125,6 +125,7 @@ async function testCommonJSOnPage() {
async function testUltraviolet() { async function testUltraviolet() {
await page.goto("http://localhost:8080/?q"); await page.goto("http://localhost:8080/?q");
<<<<<<< HEAD
// Wait for the document's readyState to be complete // Wait for the document's readyState to be complete
await page.waitForFunction(() => document.readyState === "complete"); await page.waitForFunction(() => document.readyState === "complete");
@ -144,6 +145,33 @@ async function testCommonJSOnPage() {
); );
throw new Error("Your browser doesn't support service workers."); throw new Error("Your browser doesn't support service workers.");
=======
const testResults = await page.evaluate(async () => {
const results = {};
await new Promise((resolve) => {
const waitForDocument = () => document.readyState === "complete"
? resolve()
: window.addEventListener("load", resolve);
// Wait until a service worker is registered before continuing.
// Also make sure the document is loaded.
const waitForWorker = async () => setTimeout(async () => (await navigator.serviceWorker.getRegistrations()).length >= 1 ? waitForDocument() : waitForWorker(), 1000);
waitForWorker();
});
if (window.goProx && window.goProx.ultraviolet) {
try {
const generatedUrl = window.goProx.ultraviolet(
"example.com",
false
);
console.log("Generated Ultraviolet URL:", generatedUrl);
results.ultraviolet = generatedUrl ? generatedUrl : "failure";
} catch (e) {
results.ultraviolet = "failure: " + e.message;
>>>>>>> 9e01004564071a2c3da4a61de0fff7ed566ee933
} }
await navigator.serviceWorker.register(stockSW); await navigator.serviceWorker.register(stockSW);

View file

@ -334,7 +334,7 @@ const RammerheadEncode = async baseUrl => {
* *
* Key: 1 = "stealth" * Key: 1 = "stealth"
* 0 = "window" * 0 = "window"
* Nothing = return as string variable * Nothing = return URL as a string
* *
* Examples: * Examples:
* Stealth mode - * Stealth mode -

View file

@ -17,9 +17,9 @@ async function registerSW() {
let wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/"; let wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/";
await BareMux.SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl }); await BareMux.SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl });
//When testing proxy support CLEAR service workers from 8080 (oI'lr whatever current port you are using) // When testing proxy support CLEAR service workers from 8080 (or whatever current port you are using)
// navigator.serviceWorker.register(stockSW).then(register => register.unregister().then(bool => console.log("Unregistered: " + bool))); // navigator.serviceWorker.register(stockSW).then(register => register.unregister().then(bool => console.log("Unregistered: " + bool)));
} }