Modified test script and minor commenting changes. Testing still not accurate due to Axios bug though.

This commit is contained in:
00Fjongl 2024-07-10 20:27:23 -05:00
parent 13c2f6c6e7
commit 9e01004564
3 changed files with 17 additions and 10 deletions

19
test.js
View file

@ -104,17 +104,24 @@ async function testCommonJSOnPage() {
async function testUltraviolet() {
await page.goto("http://localhost:8080/?q");
// Wait for the service worker to be active
await page.waitForFunction(
() => navigator.serviceWorker.controller !== null
);
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 = await window.goProx.ultraviolet(
const generatedUrl = window.goProx.ultraviolet(
"example.com",
false
);

View file

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

View file

@ -17,9 +17,9 @@ async function registerSW() {
let wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/";
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)));
}