@oxog/react-check 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cli.js +86 -23
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +27 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +27 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -739,6 +739,8 @@ var init_browser = __esm({
|
|
|
739
739
|
"--disable-setuid-sandbox",
|
|
740
740
|
"--disable-dev-shm-usage",
|
|
741
741
|
"--disable-gpu",
|
|
742
|
+
"--ignore-certificate-errors",
|
|
743
|
+
"--ignore-certificate-errors-spki-list",
|
|
742
744
|
`--window-size=${this.options.width},${this.options.height}`,
|
|
743
745
|
...this.options.args
|
|
744
746
|
];
|
|
@@ -795,25 +797,37 @@ var init_browser = __esm({
|
|
|
795
797
|
});
|
|
796
798
|
}
|
|
797
799
|
/**
|
|
798
|
-
* Navigate to a URL
|
|
800
|
+
* Navigate to a URL with retry support
|
|
799
801
|
* @param url - URL to navigate to
|
|
802
|
+
* @param retries - Number of retries (default: 3)
|
|
803
|
+
* @param retryDelay - Delay between retries in ms (default: 2000)
|
|
800
804
|
*/
|
|
801
|
-
async navigate(url) {
|
|
805
|
+
async navigate(url, retries = 3, retryDelay = 2e3) {
|
|
802
806
|
if (!this.page) {
|
|
803
807
|
throw new Error("Browser not launched");
|
|
804
808
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
809
|
+
let lastError = null;
|
|
810
|
+
for (let attempt = 1; attempt <= retries; attempt++) {
|
|
811
|
+
try {
|
|
812
|
+
await this.page.goto(url, {
|
|
813
|
+
waitUntil: "networkidle2",
|
|
814
|
+
timeout: this.options.timeout
|
|
815
|
+
});
|
|
816
|
+
this.emit("navigated", { url });
|
|
817
|
+
logger3.info(`Navigated to ${url}`);
|
|
818
|
+
return;
|
|
819
|
+
} catch (error) {
|
|
820
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
821
|
+
this.emit("error", lastError);
|
|
822
|
+
if (lastError.message.includes("ERR_CONNECTION_REFUSED") && attempt < retries) {
|
|
823
|
+
logger3.warn(`Connection refused, retrying in ${retryDelay}ms... (${attempt}/${retries})`);
|
|
824
|
+
await new Promise((resolve2) => setTimeout(resolve2, retryDelay));
|
|
825
|
+
continue;
|
|
826
|
+
}
|
|
827
|
+
throw lastError;
|
|
828
|
+
}
|
|
816
829
|
}
|
|
830
|
+
throw lastError ?? new Error("Navigation failed");
|
|
817
831
|
}
|
|
818
832
|
/**
|
|
819
833
|
* Execute script in page context
|