@jeniex/utils 1.0.25 → 1.0.26
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/browser/index.cjs +5 -1
- package/browser/index.d.ts +4 -0
- package/browser/index.js +5 -1
- package/package.json +1 -1
package/browser/index.cjs
CHANGED
|
@@ -307,6 +307,10 @@ function removeSearchParams(keys, fullURL) {
|
|
|
307
307
|
return updatedURL.join('');
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
+
/**
|
|
311
|
+
* Checks if the VPN is active by accessing the router address.
|
|
312
|
+
* Tested on Opera browser build-in VPN only.
|
|
313
|
+
*/
|
|
310
314
|
async function checkVPN() {
|
|
311
315
|
let pass = false;
|
|
312
316
|
try {
|
|
@@ -369,7 +373,7 @@ async function imageLoad(img) {
|
|
|
369
373
|
* Waits for the page to load.
|
|
370
374
|
* @param completely Whether or not to wait for resources to load as well.
|
|
371
375
|
*/
|
|
372
|
-
async function pageLoad(completely) {
|
|
376
|
+
async function pageLoad(completely = false) {
|
|
373
377
|
return new Promise((resolve) => {
|
|
374
378
|
if (document.readyState === 'complete') {
|
|
375
379
|
resolve();
|
package/browser/index.d.ts
CHANGED
|
@@ -112,6 +112,10 @@ declare const logId: string;
|
|
|
112
112
|
/** The initial tab URL on the script run. */
|
|
113
113
|
declare const tabURL: string;
|
|
114
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Checks if the VPN is active by accessing the router address.
|
|
117
|
+
* Tested on Opera browser build-in VPN only.
|
|
118
|
+
*/
|
|
115
119
|
declare function checkVPN(): Promise<void>;
|
|
116
120
|
declare function checkVPNRandomly(): Promise<void>;
|
|
117
121
|
|
package/browser/index.js
CHANGED
|
@@ -305,6 +305,10 @@ function removeSearchParams(keys, fullURL) {
|
|
|
305
305
|
return updatedURL.join('');
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
+
/**
|
|
309
|
+
* Checks if the VPN is active by accessing the router address.
|
|
310
|
+
* Tested on Opera browser build-in VPN only.
|
|
311
|
+
*/
|
|
308
312
|
async function checkVPN() {
|
|
309
313
|
let pass = false;
|
|
310
314
|
try {
|
|
@@ -367,7 +371,7 @@ async function imageLoad(img) {
|
|
|
367
371
|
* Waits for the page to load.
|
|
368
372
|
* @param completely Whether or not to wait for resources to load as well.
|
|
369
373
|
*/
|
|
370
|
-
async function pageLoad(completely) {
|
|
374
|
+
async function pageLoad(completely = false) {
|
|
371
375
|
return new Promise((resolve) => {
|
|
372
376
|
if (document.readyState === 'complete') {
|
|
373
377
|
resolve();
|