Skip to content

Commit

Permalink
Modified test script and minor commenting changes. Testing still not …
Browse files Browse the repository at this point in the history
…accurate due to Axios bug though.
  • Loading branch information
00Fjongl committed Jul 11, 2024
1 parent 13c2f6c commit 9e01004
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
19 changes: 13 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
2 changes: 1 addition & 1 deletion views/assets/js/common-16451543478.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down
6 changes: 3 additions & 3 deletions views/assets/js/register-sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ 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)));

}

registerSW();

0 comments on commit 9e01004

Please sign in to comment.