mirror of
https://github.com/QuiteAFancyEmerald/Holy-Unblocker.git
synced 2025-05-13 03:50:02 -04:00
Modified test script and minor commenting changes. Testing still not accurate due to Axios bug though.
This commit is contained in:
parent
13c2f6c6e7
commit
9e01004564
3 changed files with 17 additions and 10 deletions
19
test.js
19
test.js
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue