@intuned/runtime-dev 1.1.3-release-test-04 → 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/.babelrc +2 -2
- package/dist/commands/api/run.js +2 -8
- package/dist/commands/auth-sessions/run-check.js +4 -18
- package/dist/commands/auth-sessions/run-create.js +1 -2
- package/dist/commands/cli-auth-sessions/create.js +1 -1
- package/dist/commands/cli-auth-sessions/utils.js +2 -1
- package/dist/commands/common/browserUtils.d.ts +1 -1
- package/dist/commands/common/browserUtils.js +1 -1
- package/dist/commands/common/getFirstLineNumber.js +4 -2
- package/dist/commands/deploy/utils.js +2 -1
- package/dist/commands/interface/run.js +6 -7
- package/dist/commands/run-api-cli/utils.js +6 -6
- package/dist/common/assets/browser_scripts.js +2143 -2509
- package/dist/common/asyncLocalStorage/index.d.ts +2 -1
- package/dist/common/cli/types.d.ts +1 -1
- package/dist/common/getPlaywrightConstructs.d.ts +1 -1
- package/dist/common/getPlaywrightConstructs.js +12 -6
- package/dist/common/jwtTokenManager.js +5 -3
- package/dist/common/runApi/errors.d.ts +1 -1
- package/dist/common/runApi/errors.js +5 -4
- package/dist/common/runApi/index.d.ts +1 -1
- package/dist/common/runApi/index.js +11 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -6
- package/dist/runtime/executionHelpers.test.js +4 -3
- package/dist/runtime/export.d.ts +0 -16
- package/dist/runtime/extendPayload.js +1 -1
- package/dist/runtime/extendTimeout.js +7 -0
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.js +0 -7
- package/package.json +3 -2
- package/template.tsconfig.json +0 -1
- package/dist/common/assets/nopecha-extension/_metadata/computed_hashes.json +0 -1
- package/dist/common/assets/nopecha-extension/_metadata/verified_contents.json +0 -1
- package/dist/common/assets/nopecha-extension/background.js +0 -1
- package/dist/common/assets/nopecha-extension/captcha/awscaptcha.js +0 -1
- package/dist/common/assets/nopecha-extension/captcha/funcaptcha.js +0 -1
- package/dist/common/assets/nopecha-extension/captcha/geetest.js +0 -1
- package/dist/common/assets/nopecha-extension/captcha/lemincaptcha.js +0 -1
- package/dist/common/assets/nopecha-extension/captcha/perimeterx.js +0 -1
- package/dist/common/assets/nopecha-extension/captcha/recaptcha.js +0 -2
- package/dist/common/assets/nopecha-extension/captcha/textcaptcha.js +0 -1
- package/dist/common/assets/nopecha-extension/captcha/turnstile.js +0 -1
- package/dist/common/assets/nopecha-extension/eventhook/loader.js +0 -1
- package/dist/common/assets/nopecha-extension/eventhook.js +0 -1
- package/dist/common/assets/nopecha-extension/icon/128.png +0 -0
- package/dist/common/assets/nopecha-extension/icon/128g.png +0 -0
- package/dist/common/assets/nopecha-extension/icon/16.png +0 -0
- package/dist/common/assets/nopecha-extension/icon/16g.png +0 -0
- package/dist/common/assets/nopecha-extension/icon/32.png +0 -0
- package/dist/common/assets/nopecha-extension/icon/32g.png +0 -0
- package/dist/common/assets/nopecha-extension/icon/48.png +0 -0
- package/dist/common/assets/nopecha-extension/icon/48g.png +0 -0
- package/dist/common/assets/nopecha-extension/lib/selector.js +0 -1
- package/dist/common/assets/nopecha-extension/locate.js +0 -76
- package/dist/common/assets/nopecha-extension/manifest.json +0 -59
- package/dist/common/assets/nopecha-extension/pages/funcaptcha-demo.js +0 -1
- package/dist/common/assets/nopecha-extension/pages/integrate.js +0 -1
- package/dist/common/assets/nopecha-extension/pages/setup.js +0 -1
- package/dist/common/assets/nopecha-extension/popup.css +0 -1
- package/dist/common/assets/nopecha-extension/popup.html +0 -19
- package/dist/common/assets/nopecha-extension/popup.js +0 -2
- package/dist/common/assets/nopecha-extension/setup.html +0 -18
- package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +0 -1
- package/dist/common/backendFunctions/getAuthSessionParameters.js +0 -38
- package/dist/runtime/getAuthSessionParameters.d.ts +0 -1
- package/dist/runtime/getAuthSessionParameters.js +0 -20
|
@@ -5,11 +5,12 @@ export declare const asyncLocalStorage: AsyncLocalStorage<InternalRunInfo>;
|
|
|
5
5
|
export declare function runWithContext<R, TArgs extends any[]>(contextData: InternalRunInfo, callback: (...args: TArgs) => R, ...args: TArgs): R;
|
|
6
6
|
interface TimeoutInfo {
|
|
7
7
|
extendTimeoutCallback?: () => Promise<void>;
|
|
8
|
+
timeoutDuration?: number;
|
|
9
|
+
timeoutTimestamp?: number;
|
|
8
10
|
}
|
|
9
11
|
export interface InternalRunInfo extends RunInfo {
|
|
10
12
|
extendedPayloads: Payload[];
|
|
11
13
|
timeoutInfo?: TimeoutInfo;
|
|
12
|
-
getAuthSessionParameters?: () => Promise<any>;
|
|
13
14
|
}
|
|
14
15
|
export declare function getExecutionContext(): InternalRunInfo | undefined;
|
|
15
16
|
export {};
|
|
@@ -7,7 +7,7 @@ exports.getPlaywrightConstructsForMode = getPlaywrightConstructsForMode;
|
|
|
7
7
|
exports.getProductionPlaywrightConstructs = getProductionPlaywrightConstructs;
|
|
8
8
|
exports.getRemotePlaywrightContext = getRemotePlaywrightContext;
|
|
9
9
|
exports.loadSessionToContext = loadSessionToContext;
|
|
10
|
-
var playwright = _interopRequireWildcard(require("playwright"));
|
|
10
|
+
var playwright = _interopRequireWildcard(require("playwright-core"));
|
|
11
11
|
var _fsExtra = _interopRequireWildcard(require("fs-extra"));
|
|
12
12
|
var fs = _fsExtra;
|
|
13
13
|
var _contextStorageStateHelpers = require("./contextStorageStateHelpers");
|
|
@@ -43,14 +43,19 @@ async function getProductionPlaywrightConstructs({
|
|
|
43
43
|
if (headless) {
|
|
44
44
|
extraArgs.push("--headless=new");
|
|
45
45
|
}
|
|
46
|
+
const executablePath = playwright.chromium.executablePath();
|
|
47
|
+
const chromium127Path = executablePath.replace("chromium-1117", "chromium-1124");
|
|
48
|
+
const isChrome127There = await (0, _fsExtra.exists)(chromium127Path);
|
|
49
|
+
const userAgent = `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${isChrome127There ? 127 : 125}.0.0.0 Safari/537.36`;
|
|
46
50
|
const userDataDir = await createUserDirWithPreferences();
|
|
47
|
-
const extensionPath = _path.default.join(__dirname, "./assets/nopecha-extension");
|
|
48
51
|
const context = await playwright.chromium.launchPersistentContext(userDataDir, {
|
|
49
|
-
headless
|
|
50
|
-
|
|
52
|
+
headless,
|
|
53
|
+
ignoreDefaultArgs: [...getChromiumLaunchArgsToIgnore(), "--headless"],
|
|
51
54
|
proxy,
|
|
55
|
+
executablePath: isChrome127There ? chromium127Path : executablePath,
|
|
56
|
+
args: extraArgs,
|
|
52
57
|
downloadsPath,
|
|
53
|
-
|
|
58
|
+
userAgent
|
|
54
59
|
});
|
|
55
60
|
context.once("close", async () => {
|
|
56
61
|
try {
|
|
@@ -86,6 +91,7 @@ async function getProductionPlaywrightConstructs({
|
|
|
86
91
|
context
|
|
87
92
|
};
|
|
88
93
|
}
|
|
94
|
+
const getChromiumLaunchArgsToIgnore = () => ["--disable-field-trial-config", "--disable-background-networking", "--enable-features=NetworkService,NetworkServiceInProcess", "--disable-background-timer-throttling", "--disable-backgrounding-occluded-windows", "--disable-back-forward-cache", "--disable-breakpad", "--disable-client-side-phishing-detection", "--disable-component-extensions-with-background-pages", "--disable-component-update", "--no-default-browser-check", "--disable-default-apps", "--disable-dev-shm-usage", "--disable-extensions", "--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,TranslateUI", "--allow-pre-commit-input", "--disable-hang-monitor", "--disable-ipc-flooding-protection", "--disable-prompt-on-repost", "--disable-renderer-backgrounding", "--force-color-profile=srgb", "--metrics-recording-only", "--no-first-run", "--enable-automation", "--password-store=basic", "--use-mock-keychain", "--no-service-autorun", "--export-tagged-pdf", "--enable-use-zoom-for-dsf=false"];
|
|
89
95
|
async function getPlaywrightConstructsForMode(mode, cdpAddress, authSession) {
|
|
90
96
|
if (mode == "playwright-standalone") {
|
|
91
97
|
if (!cdpAddress) {
|
|
@@ -157,7 +163,7 @@ async function loadSessionToContext({
|
|
|
157
163
|
await (0, _contextStorageStateHelpers.setStorageState)(context, sessionToLoad);
|
|
158
164
|
}
|
|
159
165
|
async function getRemotePlaywrightContext(cdpAddress) {
|
|
160
|
-
const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("playwright")));
|
|
166
|
+
const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("playwright-core")));
|
|
161
167
|
let browser = null;
|
|
162
168
|
if (!cdpAddress) {
|
|
163
169
|
throw new Error("cdpAddress is required");
|
|
@@ -36,7 +36,8 @@ class JwtTokenManager {
|
|
|
36
36
|
return Math.max(timeToRefresh, timeWindow);
|
|
37
37
|
}
|
|
38
38
|
async scheduleTokenRefresh() {
|
|
39
|
-
|
|
39
|
+
var _process$env$RUN_ENVI;
|
|
40
|
+
if (((_process$env$RUN_ENVI = process.env.RUN_ENVIRONMENT) === null || _process$env$RUN_ENVI === void 0 ? void 0 : _process$env$RUN_ENVI.toLowerCase()) !== "authoring") return;
|
|
40
41
|
const timeToRefresh = this.timeToRefresh;
|
|
41
42
|
if (timeToRefresh === undefined) return;
|
|
42
43
|
if (this.tokenRefreshTimeout) clearTimeout(this.tokenRefreshTimeout);
|
|
@@ -50,7 +51,8 @@ class JwtTokenManager {
|
|
|
50
51
|
}, timeToRefresh);
|
|
51
52
|
}
|
|
52
53
|
async refreshToken() {
|
|
53
|
-
|
|
54
|
+
var _process$env$RUN_ENVI2;
|
|
55
|
+
if (((_process$env$RUN_ENVI2 = process.env.RUN_ENVIRONMENT) === null || _process$env$RUN_ENVI2 === void 0 ? void 0 : _process$env$RUN_ENVI2.toLowerCase()) !== "authoring") return;
|
|
54
56
|
const res = await this.fetchWithToken(this.refreshTokenPath, {
|
|
55
57
|
method: "GET"
|
|
56
58
|
});
|
|
@@ -63,7 +65,7 @@ class JwtTokenManager {
|
|
|
63
65
|
if (newToken) this._token = newToken;
|
|
64
66
|
}
|
|
65
67
|
fetchWithToken(...[input, init]) {
|
|
66
|
-
const headers = new Headers(init
|
|
68
|
+
const headers = new Headers(init === null || init === void 0 ? void 0 : init.headers);
|
|
67
69
|
headers.set("Authorization", `Bearer ${this.token}`);
|
|
68
70
|
return (0, _crossFetch.default)(input, {
|
|
69
71
|
...init,
|
|
@@ -10,7 +10,7 @@ export declare const maxLevelsExceededErrorCode = "MaxLevelsExceededError";
|
|
|
10
10
|
export declare const automationError = "AutomationError";
|
|
11
11
|
export declare const internalInvalidInputErrorCode = "InternalInvalidInputError";
|
|
12
12
|
export declare const runAutomationErrorCodes: readonly ["APINotFoundError", "InvalidAPIError", "InvalidCheckError", "AbortedError", "AuthRequiredError", "AuthCheckNotFoundError", "AuthCheckFailedError", "MaxLevelsExceededError", "AutomationError", "InternalInvalidInputError"];
|
|
13
|
-
export type RunAutomationErrorCode = typeof runAutomationErrorCodes[number];
|
|
13
|
+
export type RunAutomationErrorCode = (typeof runAutomationErrorCodes)[number];
|
|
14
14
|
export declare abstract class RunAutomationError<T = any> {
|
|
15
15
|
code: RunAutomationErrorCode;
|
|
16
16
|
statusCode: number;
|
|
@@ -22,10 +22,11 @@ const runAutomationErrorCodes = exports.runAutomationErrorCodes = [apiNotFoundEr
|
|
|
22
22
|
class RunAutomationError {
|
|
23
23
|
wrapped = false;
|
|
24
24
|
get json() {
|
|
25
|
+
var _this$cause;
|
|
25
26
|
return {
|
|
26
27
|
code: this.code,
|
|
27
28
|
details: this.details,
|
|
28
|
-
cause: this.cause
|
|
29
|
+
cause: (_this$cause = this.cause) === null || _this$cause === void 0 ? void 0 : _this$cause.json
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -135,10 +136,10 @@ class AutomationError extends RunAutomationError {
|
|
|
135
136
|
};
|
|
136
137
|
}
|
|
137
138
|
this.statusCode = 500;
|
|
138
|
-
this.message = `[${error
|
|
139
|
+
this.message = `[${(error === null || error === void 0 ? void 0 : error.name) ?? error}] ${error === null || error === void 0 ? void 0 : error.message}`;
|
|
139
140
|
this.details = {
|
|
140
|
-
name: error
|
|
141
|
-
message: error
|
|
141
|
+
name: error === null || error === void 0 ? void 0 : error.name,
|
|
142
|
+
message: error === null || error === void 0 ? void 0 : error.message
|
|
142
143
|
};
|
|
143
144
|
}
|
|
144
145
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Result } from "neverthrow";
|
|
2
2
|
import { RunAutomationError } from "./errors";
|
|
3
|
-
import { Page, BrowserContext } from "playwright";
|
|
3
|
+
import { Page, BrowserContext } from "playwright-core";
|
|
4
4
|
import { ExtendedRunApiParameters, RunApiResult, RunApiResultWithSessionOk } from "./types";
|
|
5
5
|
export * from "./types";
|
|
6
6
|
export * from "./errors";
|
|
@@ -80,15 +80,17 @@ async function* runApiGenerator({
|
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
try {
|
|
83
|
-
|
|
83
|
+
var _context;
|
|
84
|
+
await ((_context = context) === null || _context === void 0 ? void 0 : _context.tracing.stop({
|
|
84
85
|
path: tracing.filePath
|
|
85
|
-
});
|
|
86
|
+
}));
|
|
86
87
|
} catch (error) {
|
|
87
|
-
console.log(errorMessage, error
|
|
88
|
+
console.log(errorMessage, error === null || error === void 0 ? void 0 : error.message);
|
|
88
89
|
await (0, _fsExtra.remove)(tracing.filePath);
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
async function* runAutomation() {
|
|
93
|
+
var _getExecutionContext;
|
|
92
94
|
let page;
|
|
93
95
|
const validatedModuleResult = await importUsingImportFunction(automationFunction.name, importFunction);
|
|
94
96
|
if (validatedModuleResult.isErr()) {
|
|
@@ -96,7 +98,7 @@ async function* runApiGenerator({
|
|
|
96
98
|
}
|
|
97
99
|
const importedModule = validatedModuleResult.value;
|
|
98
100
|
let checkFn;
|
|
99
|
-
if (auth
|
|
101
|
+
if (auth !== null && auth !== void 0 && auth.runCheck) {
|
|
100
102
|
if (!auth.session) {
|
|
101
103
|
return (0, _neverthrow.err)(new _errors.AuthRequiredError());
|
|
102
104
|
}
|
|
@@ -128,7 +130,7 @@ async function* runApiGenerator({
|
|
|
128
130
|
headless,
|
|
129
131
|
proxy,
|
|
130
132
|
downloadsPath,
|
|
131
|
-
storageState: auth
|
|
133
|
+
storageState: auth === null || auth === void 0 ? void 0 : auth.session
|
|
132
134
|
}));
|
|
133
135
|
} else {
|
|
134
136
|
const {
|
|
@@ -138,7 +140,7 @@ async function* runApiGenerator({
|
|
|
138
140
|
({
|
|
139
141
|
page,
|
|
140
142
|
context
|
|
141
|
-
} = await (0, _getPlaywrightConstructs.getPlaywrightConstructsForMode)(mode, cdpAddress, auth
|
|
143
|
+
} = await (0, _getPlaywrightConstructs.getPlaywrightConstructsForMode)(mode, cdpAddress, auth === null || auth === void 0 ? void 0 : auth.session));
|
|
142
144
|
}
|
|
143
145
|
if (tracing.enabled) {
|
|
144
146
|
await context.tracing.start({
|
|
@@ -183,7 +185,7 @@ async function* runApiGenerator({
|
|
|
183
185
|
}
|
|
184
186
|
return (0, _neverthrow.ok)({
|
|
185
187
|
result,
|
|
186
|
-
extendedPayloads: (0, _asyncLocalStorage.getExecutionContext)()
|
|
188
|
+
extendedPayloads: (_getExecutionContext = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext === void 0 ? void 0 : _getExecutionContext.extendedPayloads,
|
|
187
189
|
session: retrieveSession ? await (0, _contextStorageStateHelpers.getStorageState)(context) : undefined
|
|
188
190
|
});
|
|
189
191
|
}
|
|
@@ -204,10 +206,11 @@ async function* runApiGenerator({
|
|
|
204
206
|
} catch (error) {
|
|
205
207
|
return (0, _neverthrow.err)(new _errors.AutomationError(error));
|
|
206
208
|
} finally {
|
|
209
|
+
var _context2;
|
|
207
210
|
await saveTraceIfNeeded({
|
|
208
211
|
errorMessage: "failed to save trace"
|
|
209
212
|
});
|
|
210
|
-
await context
|
|
213
|
+
await ((_context2 = context) === null || _context2 === void 0 ? void 0 : _context2.close());
|
|
211
214
|
if (downloadsPath !== undefined) {
|
|
212
215
|
await fs.remove(downloadsPath);
|
|
213
216
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP,
|
|
1
|
+
export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP, } from "./runtime";
|
|
2
2
|
export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
|
|
3
3
|
export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
|
|
4
4
|
export { getProductionPlaywrightConstructs } from "./common/getPlaywrightConstructs";
|
package/dist/index.js
CHANGED
|
@@ -21,12 +21,6 @@ Object.defineProperty(exports, "extendTimeout", {
|
|
|
21
21
|
return _runtime.extendTimeout;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "getAuthSessionParameters", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _runtime.getAuthSessionParameters;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
24
|
Object.defineProperty(exports, "getDownloadDirectoryPath", {
|
|
31
25
|
enumerable: true,
|
|
32
26
|
get: function () {
|
|
@@ -24,12 +24,13 @@ var _enums = require("./enums");
|
|
|
24
24
|
runId: "test-run-id",
|
|
25
25
|
extendedPayloads: []
|
|
26
26
|
}, () => {
|
|
27
|
-
|
|
27
|
+
var _getExecutionContext, _getExecutionContext2;
|
|
28
|
+
(0, _vitest.expect)((_getExecutionContext = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext === void 0 ? void 0 : _getExecutionContext.extendedPayloads).toEqual([]);
|
|
28
29
|
(0, _.extendPayload)({
|
|
29
30
|
api: "test-api",
|
|
30
31
|
parameters: {}
|
|
31
32
|
});
|
|
32
|
-
(0, _vitest.expect)((0, _asyncLocalStorage.getExecutionContext)()
|
|
33
|
+
(0, _vitest.expect)((_getExecutionContext2 = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext2 === void 0 ? void 0 : _getExecutionContext2.extendedPayloads).toEqual([{
|
|
33
34
|
api: "test-api",
|
|
34
35
|
parameters: {}
|
|
35
36
|
}]);
|
|
@@ -46,7 +47,7 @@ var _enums = require("./enums");
|
|
|
46
47
|
parameters: {}
|
|
47
48
|
});
|
|
48
49
|
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
49
|
-
(0, _vitest.expect)(context
|
|
50
|
+
(0, _vitest.expect)(context === null || context === void 0 ? void 0 : context.extendedPayloads).toHaveLength(4);
|
|
50
51
|
});
|
|
51
52
|
});
|
|
52
53
|
});
|
package/dist/runtime/export.d.ts
CHANGED
|
@@ -99,7 +99,6 @@ export interface RunInfo {
|
|
|
99
99
|
jobRunId?: string;
|
|
100
100
|
queueId?: string;
|
|
101
101
|
proxy?: string;
|
|
102
|
-
authSessionId?: string;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
/**
|
|
@@ -201,18 +200,3 @@ export declare function requestMultipleChoice(
|
|
|
201
200
|
* ```
|
|
202
201
|
*/
|
|
203
202
|
export declare function requestOTP(message: string): unknown;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Retrieves the parameters for the authentication session currently being used.
|
|
207
|
-
*
|
|
208
|
-
* @returns {AuthSessionParameters} An object containing the parameters for the current authentication session.
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```typescript getAuthSessionParameters
|
|
212
|
-
* import { getAuthSessionParameters } from "@intuned/sdk/runtime"
|
|
213
|
-
*
|
|
214
|
-
* const authSessionParams = getAuthSessionParameters();
|
|
215
|
-
* console.log(authSessionParams);
|
|
216
|
-
* ```
|
|
217
|
-
*/
|
|
218
|
-
export declare function getAuthSessionParameters(): Promise<any>;
|
|
@@ -16,6 +16,6 @@ function extendPayload(payload) {
|
|
|
16
16
|
context.extendedPayloads = [...items];
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
context
|
|
19
|
+
context === null || context === void 0 || context.extendedPayloads.push(...items);
|
|
20
20
|
(0, _extendTimeout.extendTimeout)();
|
|
21
21
|
}
|
|
@@ -17,6 +17,13 @@ function extendTimeout() {
|
|
|
17
17
|
if (!timeoutInfo) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
+
if (timeoutInfo.timeoutTimestamp !== undefined && timeoutInfo.timeoutDuration !== undefined) {
|
|
21
|
+
const newTimeoutStamp = Date.now() + timeoutInfo.timeoutDuration;
|
|
22
|
+
if (newTimeoutStamp - timeoutInfo.timeoutTimestamp < _DEBOUNCE_TIME) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
timeoutInfo.timeoutTimestamp = newTimeoutStamp;
|
|
26
|
+
}
|
|
20
27
|
if (timeoutInfo.extendTimeoutCallback !== undefined) {
|
|
21
28
|
void timeoutInfo.extendTimeoutCallback().catch(() => undefined);
|
|
22
29
|
}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { extendPayload } from "./extendPayload";
|
|
2
2
|
export { extendTimeout } from "./extendTimeout";
|
|
3
|
-
export { getAuthSessionParameters } from "./getAuthSessionParameters";
|
|
4
3
|
export { runInfo } from "./runInfo";
|
|
5
4
|
export { RunError } from "./RunError";
|
|
6
5
|
export { requestMultipleChoice, requestOTP } from "./requestMoreInfo";
|
package/dist/runtime/index.js
CHANGED
|
@@ -21,12 +21,6 @@ Object.defineProperty(exports, "extendTimeout", {
|
|
|
21
21
|
return _extendTimeout.extendTimeout;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "getAuthSessionParameters", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _getAuthSessionParameters.getAuthSessionParameters;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
24
|
Object.defineProperty(exports, "getDownloadDirectoryPath", {
|
|
31
25
|
enumerable: true,
|
|
32
26
|
get: function () {
|
|
@@ -53,7 +47,6 @@ Object.defineProperty(exports, "runInfo", {
|
|
|
53
47
|
});
|
|
54
48
|
var _extendPayload = require("./extendPayload");
|
|
55
49
|
var _extendTimeout = require("./extendTimeout");
|
|
56
|
-
var _getAuthSessionParameters = require("./getAuthSessionParameters");
|
|
57
50
|
var _runInfo = require("./runInfo");
|
|
58
51
|
var _RunError = require("./RunError");
|
|
59
52
|
var _requestMoreInfo = require("./requestMoreInfo");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime-dev",
|
|
3
|
-
"version": "1.1.3
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"minimatch": "10.0.1",
|
|
84
84
|
"nanoid": "3",
|
|
85
85
|
"neverthrow": "6.1.0",
|
|
86
|
+
"playwright": "1.44.1",
|
|
86
87
|
"playwright-extra": "4.3.6",
|
|
87
88
|
"prettier": "2.8.0",
|
|
88
89
|
"promptly": "3.2.0",
|
|
@@ -130,6 +131,6 @@
|
|
|
130
131
|
"vitest": "^1.1.3"
|
|
131
132
|
},
|
|
132
133
|
"peerDependencies": {
|
|
133
|
-
"
|
|
134
|
+
"@intuned/runtime": "*"
|
|
134
135
|
}
|
|
135
136
|
}
|
package/template.tsconfig.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file_hashes":[{"block_hashes":["5+2q32ZHR80eN/SkSLc0RrgqFug1kTYS5414VTPGE9w=","nK7ZefoGQCui3eiPi8E/sb00T3CJg1Snv8NFnYYEdr0=","JEQC6Yno1hl/ZzHUzE9FuZMOxvSTeey8fFhjr5Yqvm4="],"block_size":4096,"path":"background.js"},{"block_hashes":["BMOmajCx+Y3L+cvnFk+94OdgpzFobQv+QzG66b1rkuU=","T5pXARxaMTjKl79pVgqkPY7wFovI0B0h789H5IMWVPI="],"block_size":4096,"path":"captcha/awscaptcha.js"},{"block_hashes":["ihbUuNc1O//pw4QvVj0eCW8rNehZpGyYGehxI+MqJng=","XAWwVhnwkoYwGHrUIhZl2CvgRnyGbQm0MmY9KIn5AgI="],"block_size":4096,"path":"captcha/funcaptcha.js"},{"block_hashes":["HElEz+OpLLn8hPEc3b8OQe47CW3hqXHLMUt504Tcd4E=","pdkWKtoFxBRJ3vA6LhIRSxszVD8aoGKrVoZP7t5cd0c=","wZ8xJMT3iFMwRfWVChoA1iN7aqQbFJQz5mHcTkVKZWc="],"block_size":4096,"path":"captcha/geetest.js"},{"block_hashes":["1fg2FZdnu8U1LW2/PQKcHmkAnd/hIrcYqCIu4m9MDzg=","0QsZfFvxQebhCiXqIP93H0+LdPPBV86JJb+szcpcBFA=","Bjd8qcnRsuKIg7XPbvhfVr81JynxuxSxWDqV/OI85iU="],"block_size":4096,"path":"captcha/lemincaptcha.js"},{"block_hashes":["V7spilHH2BjyZzQgBCMQuyIPVSjwiyFJw1EF/53foMk="],"block_size":4096,"path":"captcha/perimeterx.js"},{"block_hashes":["L0g7ixbkEYGyHONUOQQPOU8OOu+PYp1M28PLXtJCNas=","8lm+hl40S6sCD0Vw2vl3MpP8ZtEp28Vylyg3OjlNkA4="],"block_size":4096,"path":"captcha/recaptcha.js"},{"block_hashes":["uKizqjqXT7utDRgVZI30z9OYXfC7koaV5H4hzA9BgM0=","RLt8CxTlaNxDsdUSCv4GeQ9pTQzVy2lJVS040W0aD18="],"block_size":4096,"path":"captcha/textcaptcha.js"},{"block_hashes":["KbGsn7bE8hW8/udjQfioBWvuEzh/0nH2iakHpCFaDYU=","UXfKfCvQy3kbFyOQAUprK+aONNj0oVtd0pPr2vNwFWc="],"block_size":4096,"path":"captcha/turnstile.js"},{"block_hashes":["JtNucIXE9yr1rFZyE1qeOVPibmcI3FtbD8/fUeF5Vac="],"block_size":4096,"path":"eventhook.js"},{"block_hashes":["2DIhj1B+IuaNhcHK0EhnBpY4JamsRpaIZ711IwI7M0E="],"block_size":4096,"path":"eventhook/loader.js"},{"block_hashes":["dnVoxq9Xd1hoXbYlzjNruBvrpwQVrVrElvqBMUC8tt4=","1FJw5HELANO4xjpGgMuKKI0Ur+k2dIxyClfvqgsKjwQ=","cZJgF8ap45g2QqCWwkB6j21gaZkH/dz7thaw6pcppoU="],"block_size":4096,"path":"icon/128g.png"},{"block_hashes":["xTmpxUmHMeq+Rlm85Dao9nAu6N+bFU9BvQyL9wJ1Tpo=","gIjTnumcntNg/SewVO/6MqNHTXZKv2I6DI5RxsgJ2GU="],"block_size":4096,"path":"icon/16g.png"},{"block_hashes":["RtrJagSgkAJ54Hvuncu2VFJiw0FA7lcyuHFtHjRvr1I=","e5AyizGNfIw3d9EUiUTXMbJ97DyZxFCnSVfyhgdhWBY="],"block_size":4096,"path":"icon/32g.png"},{"block_hashes":["7+zNNqS6ZZDpovo+PfJROxentYS19yiUJB3qi+ED+lQ=","R7hxEiC19mgAHvvPa5gJyAjQLMd1rJpHmFLcFa10Qs4=","qKhhJdsqF+b4o9b5istijuNge0BE/U2qx/zxeunFkQ8="],"block_size":4096,"path":"icon/48g.png"},{"block_hashes":["O4wsVKJslquLPUKVlJJYk72NPEgwgJDVZa3TR/yygls=","h+HBEkcJuaSAQw9aTzaoHiZDdLPPdVHv8o/uMhJ6Q5Q=","T/xCntd1b9jAI1wuJ113TiN1cAJqC+3wEumm5FBpzcM="],"block_size":4096,"path":"lib/selector.js"},{"block_hashes":["4GM1/ILISSKokA0wMl0kPkxt7ljS9qGlnAR8CGd9wNw=","rB4S1405A1ydrJaZ/ZJsLCO6bBuJTYmXC8kmQ2yVNJI=","bGH2xT28HmbltK0jlUVCO//d5rXZ7QR6wrnHVq8oy4g="],"block_size":4096,"path":"locate.js"},{"block_hashes":["CpVJb82GL0zfiUAupTD8VYs7GNQoxKR4jICBz6NzIz0=","HqHroYBMJsl06vXqDlPj6D3N/0O1UDnT6fbMWEb+sRg=","W+TR0bemT28DkjPSNiApNxa5Z56wD8pE/EyHo7dqk8M=","80lU8JZG3JOs8GOL7VmPj/xKzodxylhJgqLS8fUoxVU="],"block_size":4096,"path":"pages/funcaptcha-demo.js"},{"block_hashes":["FjppqhjVuXSB/vot51fZWh5xUbpPLq/srSewp8lDDAk="],"block_size":4096,"path":"pages/integrate.js"},{"block_hashes":["MSOZUnzrMiKBs9yLZ2a3oC2pD2nXRVokUOiKGSANF30="],"block_size":4096,"path":"pages/setup.js"},{"block_hashes":["9WGr1z8eVlTUGYzOHayKQzuETfDiC4mJ2gNsYdF0EYE=","BRgLK0n4q220+n4UYi609bhH/jTaKDhaeUkrjCLbbtg=","H3CNMNOKZHtSgp+h44Ldw0M19QsydKtHx73U2O9/tRY="],"block_size":4096,"path":"popup.css"},{"block_hashes":["Lr1DraJUwLFC89HHeGAk6UH6QnBREHPYZc8OILX+fOE="],"block_size":4096,"path":"popup.html"},{"block_hashes":["OMOD36I1S8+XuYREm6hgvZYZLngn6IpcwzpmhnwLLR4=","SehUlc7zeOizVDR5mpw9bvCIIpp057iQg4J4ojmbs/A=","ckFQQGi3kr3jcwJTfVHhxd2yGrCE6jKY7cuEBLdMqSk=","e65LSyjnrYadsomlIGTTfTHVIx4I5opYG0deNHExfuE=","Z/SPJ3snrLx6uXC9LDS8FQ10l9ht/IwI6isbc3sZdgY=","0Hk91nTbBmb4RllGVdu/dMKLM554naO5NIptpC+EnJM=","YrkNz5Ds2Iq/B5WOx6IZsXTk/h+dXRSoUGybooE83mU=","4tYh+Ck/A+ILeB19l8KG5lXyrDNcQTvWcXOYrgkTclA=","ZvwTEe0G+smFZQOtv+4tFcW8XcrTjZ4HkVW2uc8FdJw=","PCBxIYoGV7orERUEYXW0iSIblCKUI5XgkasnOZBgCFg=","ggDfhOjsYLzo+svjHGNbc5aCvAU508DXjlzFP0BLTwU=","m48/7Gfu/EySCKV7eL67HQv2YTiasbkWUJ2Xaryu820=","kJa1Cy84O/N8/UDVp2I2Ru0m1xL77JORwsfak3bxc0U=","TKGmP97DXbZIxZ4Tp/K5P0B8jRXcaqLRZnyeuW3MFqA=","TjFvl1SFlC5+EzlOEKaBzVQqibJ6TUd0hp7RnLPKYuE="],"block_size":4096,"path":"popup.js"},{"block_hashes":["5JGO7r2cfjBRUy3kulzECH4TPRpYSle90u/G41CsKBU="],"block_size":4096,"path":"setup.html"}],"version":2}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"description":"treehash per file","signed_content":{"payload":"eyJjb250ZW50X2hhc2hlcyI6W3siYmxvY2tfc2l6ZSI6NDA5NiwiZGlnZXN0Ijoic2hhMjU2IiwiZmlsZXMiOlt7InBhdGgiOiJiYWNrZ3JvdW5kLmpzIiwicm9vdF9oYXNoIjoiVkJVTTdDUmUwV3REQ1FDNkl0UmxZZGh6RDRJV0syVGdCVERBMDZQbHlEMCJ9LHsicGF0aCI6ImNhcHRjaGEvYXdzY2FwdGNoYS5qcyIsInJvb3RfaGFzaCI6IjFfWC1xRHBMVWdrYUhVM0NCQWVfbEZyS1JGX0xVNDdiNWxFSXk0MHEzdWMifSx7InBhdGgiOiJjYXB0Y2hhL2Z1bmNhcHRjaGEuanMiLCJyb290X2hhc2giOiJaalRLbnBnOEV1bU1qRS1qdHpxeGFCTDJEaDVkR3BOVWhTSzlPTmpoazhJIn0seyJwYXRoIjoiY2FwdGNoYS9nZWV0ZXN0LmpzIiwicm9vdF9oYXNoIjoiUVVfSk5NYjktUFROemlGOHJyVzFCWDNqNHJvcTJQRTBMUG5RRTMxbkppbyJ9LHsicGF0aCI6ImNhcHRjaGEvbGVtaW5jYXB0Y2hhLmpzIiwicm9vdF9oYXNoIjoiNmpidWUwSVQ1V2tKT0l1bmgwNHJqUG5oMTBnQmplRzJKSjV6NGp2TW10WSJ9LHsicGF0aCI6ImNhcHRjaGEvcGVyaW1ldGVyeC5qcyIsInJvb3RfaGFzaCI6IlY3c3BpbEhIMkJqeVp6UWdCQ01RdXlJUFZTandpeUZKdzFFRl81M2ZvTWsifSx7InBhdGgiOiJjYXB0Y2hhL3JlY2FwdGNoYS5qcyIsInJvb3RfaGFzaCI6IjVQRWtXdE56NlR0S2wwTmRqdDVCRzJVVWl3RjFYeVQtQ2pkci1xclRoN28ifSx7InBhdGgiOiJjYXB0Y2hhL3RleHRjYXB0Y2hhLmpzIiwicm9vdF9oYXNoIjoiampodGZubjF6THNFR2h6cGFnZjJYMEVRTVhZTGVPR2RuSWxlTVJJQnNjVSJ9LHsicGF0aCI6ImNhcHRjaGEvdHVybnN0aWxlLmpzIiwicm9vdF9oYXNoIjoickoxNHdZOU9xcV9WYVhDdG9Jd2w5cklqTmhZSlkybGd5TG9DSEdmdHg1WSJ9LHsicGF0aCI6ImV2ZW50aG9vay5qcyIsInJvb3RfaGFzaCI6Ikp0TnVjSVhFOXlyMXJGWnlFMXFlT1ZQaWJtY0kzRnRiRDhfZlVlRjVWYWMifSx7InBhdGgiOiJldmVudGhvb2svbG9hZGVyLmpzIiwicm9vdF9oYXNoIjoiMkRJaGoxQi1JdWFOaGNISzBFaG5CcFk0SmFtc1JwYUlaNzExSXdJN00wRSJ9LHsicGF0aCI6Imljb24vMTI4LnBuZyIsInJvb3RfaGFzaCI6IncySTdfMEdOODFOaFozMFlTSnl6WXhvYjVoaGZHeExsTExiQU1jTExHUGMifSx7InBhdGgiOiJpY29uLzEyOGcucG5nIiwicm9vdF9oYXNoIjoiLVFMc0ZMVkllS2lMQ0toUHVWd3RPR2x4Y1hXekxDVGpCa3lUcUwyYzFacyJ9LHsicGF0aCI6Imljb24vMTYucG5nIiwicm9vdF9oYXNoIjoiUHpwT1kwTlgzTzNGUWRMZkJhYkdXVDQ1TmxrWGR4VEkwVFRnVURDazJFdyJ9LHsicGF0aCI6Imljb24vMTZnLnBuZyIsInJvb3RfaGFzaCI6IjZOX1oyNFJQd3lZcG5Bc1hWQjVINU9OMkl1amZ0MGtZbGVadTNNXzZwR1kifSx7InBhdGgiOiJpY29uLzMyLnBuZyIsInJvb3RfaGFzaCI6Im1xcE8tTFhfdGR2QjU0aTk3M0JUa0luRGJZZ1JEaW5LSkJ0UkI5Z093a1kifSx7InBhdGgiOiJpY29uLzMyZy5wbmciLCJyb290X2hhc2giOiJCNjJ2OFp5SWEyV211WTJoNzRET21YeFg4U3RBVzgyaDFnNjRCclpyYlFZIn0seyJwYXRoIjoiaWNvbi80OC5wbmciLCJyb290X2hhc2giOiJvWUxpMHhNVVNlcXZxc0xZXzFYTi1GRzhSWGhjeXQyMXdvQXlWVjJwOXVvIn0seyJwYXRoIjoiaWNvbi80OGcucG5nIiwicm9vdF9oYXNoIjoiMkc5LTVqTVRZWTJha1h5dUEzSWNUcFd5Y3h3UXhvNDI1U0E2X005b3VaSSJ9LHsicGF0aCI6ImxpYi9zZWxlY3Rvci5qcyIsInJvb3RfaGFzaCI6Ijg2Vy1OdjBlMDlYa0RWb0F1WHN3MUlqYkJ1cXVNem1kaEZsTjZNS0ZxcFkifSx7InBhdGgiOiJsb2NhdGUuanMiLCJyb290X2hhc2giOiJtRTd0ZXhsa3pjXzNTaG04akZWN2RYYjhYS0dXQk5ITS1kOWs2UmE3cklVIn0seyJwYXRoIjoibWFuaWZlc3QuanNvbiIsInJvb3RfaGFzaCI6IktHSGR5Zms1X3RuVnRRaGFSaHhmNTR6UkN4bGtZQkgwWEpYbk1aU1NMN2MifSx7InBhdGgiOiJwYWdlcy9mdW5jYXB0Y2hhLWRlbW8uanMiLCJyb290X2hhc2giOiJaVzYwSjFiYkpqdkp3cWtqVkxyRXNGdmJVbUNvUzVfMHJGTVQxUXdiT1ZJIn0seyJwYXRoIjoicGFnZXMvaW50ZWdyYXRlLmpzIiwicm9vdF9oYXNoIjoiRmpwcHFoalZ1WFNCX3ZvdDUxZlpXaDV4VWJwUExxX3NyU2V3cDhsRERBayJ9LHsicGF0aCI6InBhZ2VzL3NldHVwLmpzIiwicm9vdF9oYXNoIjoiTVNPWlVuenJNaUtCczl5TFoyYTNvQzJwRDJuWFJWb2tVT2lLR1NBTkYzMCJ9LHsicGF0aCI6InBvcHVwLmNzcyIsInJvb3RfaGFzaCI6IjZ4TTJQV0hnbTlLa1hQQ0ZaaXNsMW5GSHlhb0VEYlNETHQ2SHJBdlVPbzgifSx7InBhdGgiOiJwb3B1cC5odG1sIiwicm9vdF9oYXNoIjoiTHIxRHJhSlV3TEZDODlISGVHQWs2VUg2UW5CUkVIUFlaYzhPSUxYLWZPRSJ9LHsicGF0aCI6InBvcHVwLmpzIiwicm9vdF9oYXNoIjoiMUhCX3ZDRW1YdER6Z0hyd0hRNWZrV1Q4Y1RNdk9BWDhyUG50TWE2NnZhOCJ9LHsicGF0aCI6InNldHVwLmh0bWwiLCJyb290X2hhc2giOiI1SkdPN3IyY2ZqQlJVeTNrdWx6RUNINFRQUnBZU2xlOTB1X0c0MUNzS0JVIn1dLCJmb3JtYXQiOiJ0cmVlaGFzaCIsImhhc2hfYmxvY2tfc2l6ZSI6NDA5Nn1dLCJpdGVtX2lkIjoiZGtubGZtamFhbmZibGdmZGZlYmhpamFsZm1obWpqam8iLCJpdGVtX3ZlcnNpb24iOiIwLjQuMTMiLCJwcm90b2NvbF92ZXJzaW9uIjoxfQ","signatures":[{"header":{"kid":"publisher"},"protected":"eyJhbGciOiJSUzI1NiJ9","signature":"JfH1es7__tiGyg0KMV9guFzIg9nfNR_3vMmrQEeSDFBSmlUCrl_4HRexruTJbKWcjdge84h0R5T3KCmMO9HMdSPfr2KAQxkm7tMt9mYV8S47l2Kh_H4SYpoH4K-KbJ2Qa5ml5BTLqCyHy9_CFQmzot0Ixte1xC0x2RJ2M-aVQ0bFa8mhE7771yuudVnyHHZR3hfZiLyDWyhQ889pczOAVrHzBk0cILdCu48pxHID9C5-AMsPPV_jgg4xsWhIJPvQGQp_7ZNCAYtP8TMZKNP3Ly9QXPW1Yd46bO4-cJ85Nvb3PHl244Yl9sgoQvHcBlv3lEe1-qupOD1yeD0r2cEeew"},{"header":{"kid":"webstore"},"protected":"eyJhbGciOiJSUzI1NiJ9","signature":"b36bPHSnD2izzT5M7So3wjS3oVVnFILPwUJEQKNrK_7TMGPfend26qf97Iopseyh8y3CD6mTKlY1HajJP6A4GjrKtEgk4kErxgpBNsoscFsFaLnqYG1GYcD7whoAayBI97XWbqvpaMLZ1MSEXKkispppc6SLXehceZnKRMOlDSG02T3-kXCm0AXqFt03m23hcQ1mzco33REAENRYKF4Hgth2umiJINC6CJOCbM12fmArumF4Mrvu2t5jB4_VjeCmSj490Ia3poH7i_rQRjVFH83BTEFLkCiaSBYRouHB89kfbjY1VMja-JJpK3NYyXDr2KMB_uii5HzWotiAIKNISw"}]}}]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{{let e="1";async function t(){return new Promise(n=>{chrome.scripting.getRegisteredContentScripts().then(a=>{n(a.map(c=>c.id))})})}let o=chrome.runtime.getManifest().content_scripts.filter(n=>n.js.includes("eventhook.js")).map(n=>n.matches);t().then(n=>{n.includes(e)||chrome.scripting.registerContentScripts([{id:e,matches:o.flat(),js:["eventhook/loader.js"],runAt:"document_start",allFrames:!0,world:"MAIN"}])})}var i=chrome;var x="https://api.nopecha.com",s="https://www.nopecha.com",j="https://developers.nopecha.com",g={doc:{url:j,automation:{url:`${j}/guides/extension_advanced/#automation-build`}},api:{url:x,recognition:{url:`${x}/recognition`},status:{url:`${x}/status`}},www:{url:s,annoucement:{url:`${s}/json/announcement.json`},demo:{url:`${s}/captcha`,recaptcha:{url:`${s}/captcha/recaptcha`},funcaptcha:{url:`${s}/captcha/funcaptcha`},awscaptcha:{url:`${s}/captcha/awscaptcha`},textcaptcha:{url:`${s}/captcha/textcaptcha`},turnstile:{url:`${s}/captcha/turnstile`},perimeterx:{url:`${s}/captcha/perimeterx`},geetest:{url:`${s}/captcha/geetest`},lemincaptcha:{url:`${s}/captcha/lemincaptcha`}},manage:{url:`${s}/manage`},pricing:{url:`${s}/pricing`},setup:{url:`${s}/setup`}},discord:{url:`${s}/discord`},github:{url:`${s}/github`,release:{url:`${s}/github/release`}}};var te="en",re="en";{let e=function(t,r,o,n){return{id:n,priority:1,action:{type:"redirect",redirect:{transform:{queryTransform:{addOrReplaceParams:[{key:t,value:r}]}}}},condition:{regexFilter:o,resourceTypes:["sub_frame"]}}};i.declarativeNetRequest.updateDynamicRules({addRules:[e("hl",te,"^https?://[^\\.]*\\.(google\\.com|recaptcha\\.net)/recaptcha",1),e("lang",re,"^https?://[^\\.]*\\.(funcaptcha\\.com?|arkoselabs\\.c(om|n)|arkose\\.com\\.cn)/fc/gc/",2)],removeRuleIds:[1,2]})}var p=new Map;chrome.tabs.onUpdated.addListener((e,t)=>{p.has(e)&&!("url"in t)||p.set(e,new Set)});chrome.tabs.onRemoved.addListener(e=>{p.delete(e)});async function U([e],t){let r=t.tab?.id;if(!r)return console.warn("[@nope/background/tabs] unable to figure out tabId");p.has(r)||p.set(r,new Set),p.get(r).add(e)}async function q(){let e=await new Promise(t=>{i.tabs.query({active:!0,currentWindow:!0},([r])=>{t(r)})});return p.has(e.id)?[...p.get(e.id)]:[]}var y={version:18,key:"",keys:[],enabled:!0,disabled_hosts:[],awscaptcha_auto_open:!1,awscaptcha_auto_solve:!1,awscaptcha_solve_delay_time:1e3,awscaptcha_solve_delay:!0,geetest_auto_open:!1,geetest_auto_solve:!1,geetest_solve_delay_time:1e3,geetest_solve_delay:!0,funcaptcha_auto_open:!0,funcaptcha_auto_solve:!0,funcaptcha_solve_delay_time:1e3,funcaptcha_solve_delay:!0,hcaptcha_auto_open:!0,hcaptcha_auto_solve:!0,hcaptcha_solve_delay_time:3e3,hcaptcha_solve_delay:!0,lemincaptcha_auto_open:!1,lemincaptcha_auto_solve:!1,lemincaptcha_solve_delay_time:1e3,lemincaptcha_solve_delay:!0,perimeterx_auto_solve:!1,perimeterx_solve_delay_time:1e3,perimeterx_solve_delay:!0,recaptcha_auto_open:!0,recaptcha_auto_solve:!0,recaptcha_solve_delay_time:2e3,recaptcha_solve_delay:!0,textcaptcha_auto_solve:!1,textcaptcha_image_selector:"",textcaptcha_input_selector:"",textcaptcha_solve_delay_time:100,textcaptcha_solve_delay:!0,turnstile_auto_solve:!0,turnstile_solve_delay_time:1e3,turnstile_solve_delay:!0};var v=i.action,R=!0;function P(e){if(e===R)return;R=e;let t=e?"":"g",r=[new Promise(o=>{v.setIcon({path:Object.fromEntries([16,32,48,128].map(n=>[n,`/icon/${n}${t}.png`]))},o)})];return w&&r.push(new Promise(o=>{v.setBadgeText({text:e?w:""},o)})),Promise.all(r)}var w="";function k(e,t){if(e!==w)return w=e,Promise.all([new Promise(r=>{if(!R)return r();v.setBadgeText({text:e},r)}),new Promise(r=>{v.setBadgeBackgroundColor({color:t},r)})])}function N(e,t){return t.tab.url}function B(){return new Promise(e=>{i.tabs.query({active:!0,currentWindow:!0},([t])=>e(t))})}async function m(){return(await B()).id}async function J(){let e=await B();return e&&e.url&&new URL(e.url).href}async function M(){let e=await B();return JSON.stringify(e)}var I=new Set,A=new Set;i.runtime.onConnect.addListener(e=>{e.name==="stream"?(I.add(e),e.onDisconnect.addListener(()=>{I.delete(e)})):e.name==="broadcast"&&(A.add(e),e.onDisconnect.addListener(()=>{A.delete(e)}))});function O(e){I.forEach(t=>t.postMessage(e))}async function F(e){let t=await m();e={data:e,event:"broadcast"},A.forEach(r=>{r.sender?.tab?.id!==void 0&&t===r.sender?.tab?.id&&r.postMessage(e)})}var L=new Promise(e=>{i.storage.local.get("settings",t=>{if(!t?.settings)return e(y);let{settings:r}=t;r.version!==y.version&&(r={...y,key:r.key}),r.enabled||P(!1),e(r)})});function f(){return L}async function E(e){let t={...await L,...e};return P(t.enabled),new Promise(r=>{i.storage.local.set({settings:t},()=>{L=Promise.resolve(t),O({event:"settingsUpdate",settings:e}),r(null)})})}var S="2";async function ne(){return new Promise(e=>{chrome.scripting.getRegisteredContentScripts().then(t=>{e(t.map(r=>r.id))})})}async function H(){let e=await f(),t=await ne();if(e.turnstile_auto_solve){if(t.includes(S))return;chrome.scripting.registerContentScripts([{id:S,matches:["*://challenges.cloudflare.com/*"],js:["captcha/turnstile.js"],runAt:"document_start",allFrames:!0,world:"MAIN"}])}else{if(!t.includes(S))return;chrome.scripting.unregisterContentScripts({ids:[S]})}}H();chrome.storage.onChanged.addListener(H);function V(){let e;return t=>e||(e=t().finally(()=>e=void 0),e)}var W,oe=V();function T(){return oe(()=>se())}async function G(){return W}var ae=i.runtime.getManifest().version;async function se(){let e=new URLSearchParams;e.append("v",ae);let t=(await f()).key;t&&e.append("key",t);let r=`${g.api.status.url}?${e.toString()}`,o,n=null;try{n=await fetch(r),o=await n.json()}catch(a){console.error("[@nope/background/api/status] failed to fetch status",n,a),o={error:-1,message:n?n.status===522?"Server not responding":n.status===502?"Server has routing issues":`Unknown server error: ${n.status}`:"Server connection failure."}}return n&&!n.ok&&(!o||!("error"in o))&&(console.error("[@nope/background/api/status] received non 2xx",n,o),o={error:-1,message:`Server error: ${n.status}`}),W=o,"error"in o?k("ERR","#FDE047"):typeof o.credit=="number"&&typeof o.quota=="number"?k(o.credit>=9999?`${Math.floor(o.credit/o.quota*100)}`:o.credit.toString(),o.credit?"#0a95ff":"#FB7185"):k("","#fff0"),o}T();function h(e){return new Promise(t=>setTimeout(t,e))}function $(e,t=2166136261){let r=t;for(let o of e)r^=o,r+=r<<1;return r>>>0}var ie=30,_=[];function C(e,t){let r;if(!t.method||t.method==="GET"){let n=new URLSearchParams(e.split("?")[1]).get("id");if(!n)return;let a=_.find(c=>{let u=c.postres[c.postres.length-1];return!u?.responseBody||!("data"in u.responseBody)?!1:u?.responseBody?.data===n});a&&(r=a.id,a.getreq={time:+new Date,url:e,options:t})}else for(r=""+[+new Date,performance.now(),Math.random()],_.push({id:r,postreq:{time:+new Date,url:e,options:t},getreq:{time:0,url:"",options:{}},postres:[],getres:[]});_.length>ie;)_.shift();return r}function b(e,t){let r=_.find(o=>o.id===e);r&&(r.getreq.time?(r.getres.push({time:+new Date,...t}),t.responseBody&&"data"in t.responseBody&&(r.answer=t.responseBody.data)):r.postres.push({time:+new Date,...t}))}function K(){return JSON.stringify(_)}var ce=[15,16,12,10,17];async function X(e){let t=new Headers;t.append("accept","application/json"),t.append("content-type","application/json");let r=typeof e.v=="string"?$(e.v.split("").map(c=>c.charCodeAt(0))):-1;e.key&&e.key!=="undefined"&&t.append("authorization",`Bearer ${e.key}`);let o;for(let c=30;c>0&&r===2860377017;c--){let u=C(g.api.url,{method:"POST",headers:t,body:e}),l=await fetch(g.api.url,{method:"POST",headers:t,body:JSON.stringify(e)});if(l.status>=500){b(u,{response:l,attempts:c}),await h(1e3);continue}let d=await l.json();if(b(u,{response:l,responseBody:d,attempts:c}),"error"in d){if(ce.includes(d.error))return d;d.error!==11&&console.warn("[@nope/background/api/recognition] unknown error",d),await h(1e3)}else{o=d.data;break}}if(!o)return{error:-1,message:"Server timeout"};t.delete("content-type");let n,a=`${g.api.url}?id=${o}&key=${e.key}`;for(let c=60;c>0;c--){n=C(a,{headers:t});let u=await fetch(a,{headers:t});if(u.status>=500){b(n,{response:u,attempts:c}),await h(1e3);continue}let l=await u.json();if(b(n,{response:u,responseBody:l,attempts:c}),"error"in l)l.error!==14&&console.warn("[@nope/background/api/recognition] unknown error",l),await h(1e3);else return l}return n&&b(n,{failed:!0}),{error:-1,message:"Server timeout"}}async function z([e,t]){let r=await fetch(e,t);return{headers:Object.fromEntries(r.headers.entries()),status:r.status,ok:r.ok,text:await r.text()}}async function Q([e,t]){let r=await fetch(e,t),o=await r.blob(),n=new FileReader;return await new Promise(a=>{n.addEventListener("load",a),n.readAsDataURL(o)}),{headers:Object.fromEntries(r.headers.entries()),status:r.status,ok:r.ok,data:n.result}}function D(e){let t=("60a8b3778b5b01f87ccc8129cd88bf0f6ec61feb879c88908365771cfcadc232"+e).split("").map(r=>r.charCodeAt(0));return Z(t)}var Y=new Uint32Array(256);for(let e=256;e--;){let t=e;for(let r=8;r--;)t=t&1?3988292384^t>>>1:t>>>1;Y[e]=t}function Z(e){let t=-1;for(let r of e)t=t>>>8^Y[t&255^r];return(t^-1)>>>0}async function ee(e){!e&&(e=await m(),!e)||chrome.scripting.executeScript({target:{tabId:e,allFrames:!0},files:["lib/selector.js","locate.js"],world:"ISOLATED",injectImmediately:!0})}var ue={"echo::sender":(e,t)=>t,"log::getLogs":K,"settings::get":f,"settings::update":([e])=>E(e),"api::fetchStatus":T,"api::getCachedStatus":G,"api::recognition":([e])=>X(e),"tab::getCurrentId":m,"tab::getCurrentJSON":M,"tab::getCurrentURL":J,"tab::getURL":N,"tab::registerDetectedCaptcha":U,"tab::getDetectedCaptchas":q,"fetch::universalFetch":z,"fetch::asData":Q,"tab::broadcast":([e])=>F(e),"locator::inject":(e,t)=>ee(t?.tab?.id)};i.runtime.onMessage.addListener((e,t,r)=>{let o=e[1],n=ue[o];return Promise.resolve(n(e.slice(2),t)).then(a=>{r([D(e[0]),a])}).catch(a=>{console.error(`[@nope/background/rpc] [${o}] errored!`,e.slice(2),a),r([D(e[0]),""+a])}),!0});})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{var s=chrome;var h="https://api.nopecha.com",o="https://www.nopecha.com",v="https://developers.nopecha.com",X={doc:{url:v,automation:{url:`${v}/guides/extension_advanced/#automation-build`}},api:{url:h,recognition:{url:`${h}/recognition`},status:{url:`${h}/status`}},www:{url:o,annoucement:{url:`${o}/json/announcement.json`},demo:{url:`${o}/captcha`,recaptcha:{url:`${o}/captcha/recaptcha`},funcaptcha:{url:`${o}/captcha/funcaptcha`},awscaptcha:{url:`${o}/captcha/awscaptcha`},textcaptcha:{url:`${o}/captcha/textcaptcha`},turnstile:{url:`${o}/captcha/turnstile`},perimeterx:{url:`${o}/captcha/perimeterx`},geetest:{url:`${o}/captcha/geetest`},lemincaptcha:{url:`${o}/captcha/lemincaptcha`}},manage:{url:`${o}/manage`},pricing:{url:`${o}/pricing`},setup:{url:`${o}/setup`}},discord:{url:`${o}/discord`},github:{url:`${o}/github`,release:{url:`${o}/github/release`}}};function S(e){let t=("60a8b3778b5b01f87ccc8129cd88bf0f6ec61feb879c88908365771cfcadc232"+e).split("").map(n=>n.charCodeAt(0));return x(t)}var M=new Uint32Array(256);for(let e=256;e--;){let t=e;for(let n=8;n--;)t=t&1?3988292384^t>>>1:t>>>1;M[e]=t}function x(e){let t=-1;for(let n of e)t=t>>>8^M[t&255^n];return(t^-1)>>>0}async function a(e,t){let n=""+[+new Date,performance.now(),Math.random()],[c,u]=await new Promise(m=>{s.runtime.sendMessage([n,e,...t],m)});if(c===S(n))return u}function B(){let e;return t=>e||(e=t().finally(()=>e=void 0),e)}var j=B(),i;function C(){return j(async()=>(i||(i=await a("settings::get",[])),i))}function q(e){i&&(i={...i,...e},A(i))}function f(){return i}function r(e){return new Promise(t=>setTimeout(t,e))}var k=[];function b(e,t){e.timedout=!1,k.push(e);let n,c=setInterval(async()=>{await $(e,f())||(clearTimeout(n),clearInterval(c))},400);t&&(n=setTimeout(()=>clearInterval(c),t),e.timedout=!0)}async function $(e,t){if(e.timedout)return!1;let n=e.condition(t);if(n===e.running())return!1;if(!n&&e.running())return e.quit(),!1;if(n&&!e.running()){for(;!e.ready();)await r(200);return e.start(),!1}}function A(e){k.forEach(t=>$(t,e))}function R(){s.runtime.connect({name:"stream"}).onMessage.addListener(t=>{t.event==="settingsUpdate"&&q(t.settings)})}function w(e){if(document.readyState!=="loading")setTimeout(e,0);else{let t;t=()=>{removeEventListener("DOMContentLoaded",t),e()},addEventListener("DOMContentLoaded",t)}}var F,_=!1;function L(){return!!(document.querySelector("#captcha-container")&&document.querySelector("#amzn-captcha-verify-button"))}function T(){_=!0,K()}function E(){F.disconnect(),_=!1}function P(){return _}async function K(){await r(400),document.querySelector("#amzn-captcha-verify-button")?.click()}function N(){if(document.querySelector('script[src*="awswaf"]')||H(document))return!0;for(let e of document.querySelectorAll("awswaf-captcha")){let t=e.shadowRoot;if(H(t))return!0}return!1}function H(e){let t=e.querySelector("#amzn-captcha-verify-button, #amzn-btn-verify-internal");return!!(e.querySelector("#captcha-container, .amzn-captcha-modal")||t)}async function O(e,t){let n={v:s.runtime.getManifest().version,key:G(e)};return n.url=await a("tab::getURL",[]),n}function G(e){return!e.keys||!e.keys.length?e.key:e.keys[Math.floor(Math.random()*e.keys.length)]}var d,y=!1;function I(){if(D(document))return!0;for(let e of document.querySelectorAll("awswaf-captcha")){let t=e.shadowRoot;if(D(t))return!0}return!1}function U(){y=!0;let e=t=>{t.filter(n=>n.type==="childList"&&n.addedNodes.length).map(n=>[...n.addedNodes]).flat().filter(n=>n.nodeName==="AWSWAF-CAPTCHA").map(n=>n.shadowRoot).forEach(n=>{d.observe(n,{subtree:!0,childList:!0}),l(n)}),[3,4,5].includes(t.length)?l(t[0].target.parentElement):t.length===1&&t[0].addedNodes.length&&t[0].addedNodes[0].id==="root"&&l(t[0].addedNodes[0])};d=new MutationObserver(e),d.observe(document,{subtree:!0,childList:!0}),l(document),document.querySelectorAll("awswaf-captcha").forEach(t=>{let n=t.shadowRoot;d.observe(n,{subtree:!0,childList:!0}),l(n)})}function W(){d.disconnect(),y=!1}function Q(){return y}function l(e){let t=e.querySelector("#amzn-btn-audio, #amzn-btn-audio-internal");e.querySelector("audio")||t?.click(),e.querySelector("audio")&&J(e),(e.querySelector("audio")||t)&&a("tab::registerDetectedCaptcha",["awscaptcha"])}function D(e){let t=e.querySelector("#amzn-btn-audio, #amzn-btn-audio-internal");return!!(e.querySelector("audio")||t)}var z;async function J(e){let t=e.querySelector("audio").src.replace("data:audio/aac;base64,","");if(t===z||(z=t,!t))return;let n=f(),c=new Date().valueOf(),u=await a("api::recognition",[{type:"awscaptcha",audio_data:[t],...await O(n)}]);if(!u||"error"in u)return;let m=new Date().valueOf();if(n.awscaptcha_solve_delay){let p=n.awscaptcha_solve_delay_time-m+c;p>0&&await r(p)}let g=u.data[0];g?(e.querySelector("input").value=g,await r(200),e.querySelector("#amzn-btn-verify-internal")?.click()):e.querySelector("#amzn-btn-refresh-internal")?.click()}async function V(){let e=!1;for(let n=0;n<3;n++)if(await r(1e3),N()){e=!0;break}if(!e)return;R(),await C(),await a("tab::registerDetectedCaptcha",["awscaptcha"]);let t=location.hostname;b({name:"awscaptcha/auto-open",condition:n=>n.enabled&&n.awscaptcha_auto_open&&!n.disabled_hosts.includes(t),ready:L,start:T,quit:E,running:P}),b({name:"awscaptcha/auto-solve",condition:n=>n.enabled&&n.awscaptcha_auto_solve&&!n.disabled_hosts.includes(t),ready:I,start:U,quit:W,running:Q})}w(V);})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{function A(){if("ancestorOrigins"in location){let t=location.ancestorOrigins,n=t[1]??t[0];if(n)return n.split("/")[2]}let e=document.referrer;return e?e.split("/")[2]:location.origin}var h=chrome;var x="https://api.nopecha.com",i="https://www.nopecha.com",L="https://developers.nopecha.com",_e={doc:{url:L,automation:{url:`${L}/guides/extension_advanced/#automation-build`}},api:{url:x,recognition:{url:`${x}/recognition`},status:{url:`${x}/status`}},www:{url:i,annoucement:{url:`${i}/json/announcement.json`},demo:{url:`${i}/captcha`,recaptcha:{url:`${i}/captcha/recaptcha`},funcaptcha:{url:`${i}/captcha/funcaptcha`},awscaptcha:{url:`${i}/captcha/awscaptcha`},textcaptcha:{url:`${i}/captcha/textcaptcha`},turnstile:{url:`${i}/captcha/turnstile`},perimeterx:{url:`${i}/captcha/perimeterx`},geetest:{url:`${i}/captcha/geetest`},lemincaptcha:{url:`${i}/captcha/lemincaptcha`}},manage:{url:`${i}/manage`},pricing:{url:`${i}/pricing`},setup:{url:`${i}/setup`}},discord:{url:`${i}/discord`},github:{url:`${i}/github`,release:{url:`${i}/github/release`}}};function P(e){let t=("60a8b3778b5b01f87ccc8129cd88bf0f6ec61feb879c88908365771cfcadc232"+e).split("").map(n=>n.charCodeAt(0));return q(t)}var E=new Uint32Array(256);for(let e=256;e--;){let t=e;for(let n=8;n--;)t=t&1?3988292384^t>>>1:t>>>1;E[e]=t}function q(e){let t=-1;for(let n of e)t=t>>>8^E[t&255^n];return(t^-1)>>>0}async function u(e,t){let n=""+[+new Date,performance.now(),Math.random()],[a,o]=await new Promise(r=>{h.runtime.sendMessage([n,e,...t],r)});if(a===P(n))return o}function b(){let e;return t=>e||(e=t().finally(()=>e=void 0),e)}var oe=b(),g;function O(){return oe(async()=>(g||(g=await u("settings::get",[])),g))}function F(e){g&&(g={...g,...e},U(g))}function _(){return g}function l(e){return new Promise(t=>setTimeout(t,e))}var N=[];function T(e,t){e.timedout=!1,N.push(e);let n,a=setInterval(async()=>{await W(e,_())||(clearTimeout(n),clearInterval(a))},400);t&&(n=setTimeout(()=>clearInterval(a),t),e.timedout=!0)}async function W(e,t){if(e.timedout)return!1;let n=e.condition(t);if(n===e.running())return!1;if(!n&&e.running())return e.quit(),!1;if(n&&!e.running()){for(;!e.ready();)await l(200);return e.start(),!1}}function U(e){N.forEach(t=>W(t,e))}function z(){h.runtime.connect({name:"stream"}).onMessage.addListener(t=>{t.event==="settingsUpdate"&&F(t.settings)})}function k(e){if(document.readyState!=="loading")setTimeout(e,0);else{let t;t=()=>{removeEventListener("DOMContentLoaded",t),e()},addEventListener("DOMContentLoaded",t)}}var Oe=b();var re=["#home_children_button","#wrong_children_button","#wrongTimeout_children_button","button[data-theme*=verifyButton]","[class*=game-fail] .button",".error .button"],G=["#root","#app","#home","#wrong","#wrongTimeout",".container[dir]"].join(", "),C,S=!1;function V(){return!!document.querySelector(G)}function j(){S=!0;let e=()=>{ie(),document.querySelectorAll(G).forEach(t=>{C.observe(t,{childList:!0})})};C=new MutationObserver(e),e()}function Q(){C.disconnect(),S=!1}function K(){return S}async function ie(){await l(400),re.map(e=>document.querySelector(e)).filter(e=>e).map(e=>e.click())}function ce(e,t){let n=document.createElement("canvas");return n.width=e,n.height=t,n}function I(e){return e.toDataURL("image/jpeg").replace(/data:image\/[a-z]+;base64,/g,"")}function se(e){try{e.getContext("2d").getImageData(0,0,1,1)}catch{return!0}return!1}async function B(e,t,n=1e4){if(!t&&!e.complete&&!await new Promise(c=>{let d=setTimeout(()=>{c(!1)},n);e.addEventListener("load",()=>{clearTimeout(d),c(!0)})}))return;let a=ce(e.naturalWidth||t?.clientWidth,e.naturalHeight||t?.clientHeight);return a.getContext("2d").drawImage(e,0,0),!se(a)&&a}async function M(e){let n=getComputedStyle(e).backgroundImage;if(!n||n==="none")if("src"in e&&e.src)n=`url("${e.src}")`;else return;if("computedStyleMap"in e&&!/url\(["']https?:\/\//.test(n)){let s=e.computedStyleMap().get("background-image");if(s instanceof CSSImageValue){let f=await B(s,e);if(f)return f}}let a=/"(.+)"/.exec(n);if(!a)return;n=a[1];let o=document.createElement("a");if(o.href=n,new URL(o.href).origin===document.location.origin){let s=new Image;s.crossOrigin="anonymous",s.src=n;let f=await B(s);if(f)return f}let r=await u("fetch::asData",[n,{}]),c=new Image;c.crossOrigin="anonymous",c.src=r.data;let d=await B(c);if(d)return d}function ue(e,t,n,a){let o=(a*t+n)*4;return[e[o],e[o+1],e[o+2]]}function le(e,t){return e.every(n=>n<=t)}function de(e,t){return e.every(n=>n>=t)}function $(e,t=0,n=230,a=.99){let o=e.getContext("2d"),r=o.canvas.width,c=o.canvas.height;if(r===0||c===0)return!0;let d=o.getImageData(0,0,r,c).data,s=0;for(let v=0;v<c;v++)for(let w=0;w<r;w++){let D=ue(d,r,w,v);(le(D,t)||de(D,n))&&s++}return s/(r*c)>a}function J(){return[]}function X(e){return new Promise(t=>{e.push(t)})}function m(e){e.forEach(t=>t()),e.splice(0)}async function Y(e,t){let n={v:h.runtime.getManifest().version,key:ge(e)};return n.url=await u("tab::getURL",[]),n}function ge(e){return!e.keys||!e.keys.length?e.key:e.keys[Math.floor(Math.random()*e.keys.length)]}var p=J(),R,y=!1;function ee(){return H()!==void 0}function te(){y=!0,m(p),R=new MutationObserver(e=>{let t=H();for(let n of e)if(n.type==="childList"&&n.removedNodes.length&&["app","game"].includes(n.target.id)){setTimeout(()=>m(p),200);return}t===1&&e.length===24&&!document.querySelector(".loading-spinner")&&setTimeout(()=>m(p),200),t===2&&[8,13].includes(e.length)&&!document.querySelector(".loading-spinner")&&setTimeout(()=>m(p),200)}),R.observe(document,{childList:!0,subtree:!0,attributes:!0}),fe()}function ne(){R.disconnect(),y=!1,m(p)}function ae(){return y}var me={[0]:{async getTask(){let e=document.querySelector("#game_children_text h2"),t=document.querySelector("#game_challengeItem_image"),n=[...document.querySelectorAll("#game_children_challenge a")];if(!(!e||!t||n.length!==6))return{payload:{type:"funcaptcha",task:e.textContent,image_data:[t.src.replace(/data:image\/[a-z]+;base64,/g,"")]},cells:n}},async solution(e,t){e.cells.forEach((n,a)=>{t.data[a]&&n.click()})}},[1]:{async getTask(){let e=document.querySelector(".tile-game h2"),t=[...document.querySelectorAll(".challenge-container button")];if(!e||t.length!==6)return;let n=await M(t[0]);if(n&&!$(n))return{payload:{type:"funcaptcha",task:e.textContent,image_data:[I(n)]},cells:t}},async solution(e,t){e.cells.forEach((n,a)=>{t.data[a]&&n.click()})}},[2]:{async getTask(){let e=document.querySelector(".match-game h2"),t=document.querySelector(".key-frame-image");if(!e||!t)return;let n=await M(t);if(n&&!$(n))return{payload:{type:"funcaptcha_match",task:e.textContent,image_data:[I(n)]}}},async solution(e,t){let n=document.querySelector(".right-arrow"),a=t.data.indexOf(!0);for(let r=0;r<a;r++)n.click(),await l(100);await l(500),document.querySelector(".button").click()}}},pe=[["script[src*=tile-game-ui]",0],[".tile-game",1],[".match-game",2]];function H(){return pe.filter(([e])=>document.querySelector(e)).map(([e,t])=>t)[0]}var Z=!1;async function fe(){if(!Z)for(Z=!0;y;){let e=H();if(e===void 0){await l(500);continue}let t=me[e],n=await t.getTask();if(!n){await l(500);continue}let a=_(),o=new Date().valueOf(),r=await u("api::recognition",[{...n.payload,...await Y(a,!0)}]);if(!r||"error"in r){await l(2e3);continue}let c=new Date().valueOf();if(a.funcaptcha_solve_delay){let s=a.funcaptcha_solve_delay_time-c+o;s>0&&await l(s)}await t.solution(n,r);let d=setTimeout(()=>{m(p)},1e3*5);await X(p),clearTimeout(d)}}async function he(){z(),await O(),await u("tab::registerDetectedCaptcha",["funcaptcha"]);let e=A();T({name:"funcaptcha/auto-open",condition:t=>t.enabled&&t.funcaptcha_auto_open&&!t.disabled_hosts.includes(e),ready:V,start:j,quit:Q,running:K}),T({name:"funcaptcha/auto-solve",condition:t=>t.enabled&&t.funcaptcha_auto_solve&&!t.disabled_hosts.includes(e),ready:ee,start:te,quit:ne,running:ae})}k(he);})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{var x=chrome;var I="https://api.nopecha.com",d="https://www.nopecha.com",U="https://developers.nopecha.com",Ie={doc:{url:U,automation:{url:`${U}/guides/extension_advanced/#automation-build`}},api:{url:I,recognition:{url:`${I}/recognition`},status:{url:`${I}/status`}},www:{url:d,annoucement:{url:`${d}/json/announcement.json`},demo:{url:`${d}/captcha`,recaptcha:{url:`${d}/captcha/recaptcha`},funcaptcha:{url:`${d}/captcha/funcaptcha`},awscaptcha:{url:`${d}/captcha/awscaptcha`},textcaptcha:{url:`${d}/captcha/textcaptcha`},turnstile:{url:`${d}/captcha/turnstile`},perimeterx:{url:`${d}/captcha/perimeterx`},geetest:{url:`${d}/captcha/geetest`},lemincaptcha:{url:`${d}/captcha/lemincaptcha`}},manage:{url:`${d}/manage`},pricing:{url:`${d}/pricing`},setup:{url:`${d}/setup`}},discord:{url:`${d}/discord`},github:{url:`${d}/github`,release:{url:`${d}/github/release`}}};function N(e){let n=("60a8b3778b5b01f87ccc8129cd88bf0f6ec61feb879c88908365771cfcadc232"+e).split("").map(t=>t.charCodeAt(0));return z(n)}var W=new Uint32Array(256);for(let e=256;e--;){let n=e;for(let t=8;t--;)n=n&1?3988292384^n>>>1:n>>>1;W[e]=n}function z(e){let n=-1;for(let t of e)n=n>>>8^W[n&255^t];return(n^-1)>>>0}async function f(e,n){let t=""+[+new Date,performance.now(),Math.random()],[o,a]=await new Promise(r=>{x.runtime.sendMessage([t,e,...n],r)});if(o===N(t))return a}function F(){let e;return n=>e||(e=n().finally(()=>e=void 0),e)}var he=F(),_;function X(){return he(async()=>(_||(_=await f("settings::get",[])),_))}function Y(e){_&&(_={..._,...e},K(_))}function B(){return _}function l(e){return new Promise(n=>setTimeout(n,e))}var Q=[];function E(e,n){e.timedout=!1,Q.push(e);let t,o=setInterval(async()=>{await j(e,B())||(clearTimeout(t),clearInterval(o))},400);n&&(t=setTimeout(()=>clearInterval(o),n),e.timedout=!0)}async function j(e,n){if(e.timedout)return!1;let t=e.condition(n);if(t===e.running())return!1;if(!t&&e.running())return e.quit(),!1;if(t&&!e.running()){for(;!e.ready();)await l(200);return e.start(),!1}}function K(e){Q.forEach(n=>j(n,e))}function V(){x.runtime.connect({name:"stream"}).onMessage.addListener(n=>{n.event==="settingsUpdate"&&Y(n.settings)})}function R(e){if(document.readyState!=="loading")setTimeout(e,0);else{let n;n=()=>{removeEventListener("DOMContentLoaded",n),e()},addEventListener("DOMContentLoaded",n)}}var _e=(e,n,t)=>new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:n,screenY:t,clientX:n,clientY:t,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});function G(e,{events:n=null,x:t=null,y:o=null}={}){let a=document.querySelector(e);if(!a)return;if(t===null||o===null){let i=a.getBoundingClientRect();t=i.left+i.width/2,o=i.top+i.height/2}let r=n??["mouseover","mousedown","mouseup","click"];for(let i of r)a.dispatchEvent(_e(i,t,o))}var $,H=!1;function J(){return!!document.querySelector(".geetest_btn_click")}function Z(){H=!0;let e=()=>{if(!document.querySelector(".geetest_captcha")?.classList.contains("geetest_nextReady"))return;document.querySelector(".geetest_btn_click").attributes["aria-label"]?.value==="Click to verify"&&ve()};$=new MutationObserver(e),$.observe(document.querySelector(".geetest_captcha"),{subtree:!0,childList:!0}),e()}function ee(){$.disconnect(),H=!1}function te(){return H}async function ve(){await l(400),G(".geetest_btn_click")}function S(e,n){let t=document.createElement("canvas");return t.width=e,t.height=n,t}function ne(e){return e.toDataURL("image/jpeg").replace(/data:image\/[a-z]+;base64,/g,"")}function we(e){try{e.getContext("2d").getImageData(0,0,1,1)}catch{return!0}return!1}async function L(e,n,t=1e4){if(!n&&!e.complete&&!await new Promise(i=>{let c=setTimeout(()=>{i(!1)},t);e.addEventListener("load",()=>{clearTimeout(c),i(!0)})}))return;let o=S(e.naturalWidth||n?.clientWidth,e.naturalHeight||n?.clientHeight);return o.getContext("2d").drawImage(e,0,0),!we(o)&&o}async function oe(e){let t=getComputedStyle(e).backgroundImage;if(!t||t==="none")if("src"in e&&e.src)t=`url("${e.src}")`;else return;if("computedStyleMap"in e&&!/url\(["']https?:\/\//.test(t)){let s=e.computedStyleMap().get("background-image");if(s instanceof CSSImageValue){let g=await L(s,e);if(g)return g}}let o=/"(.+)"/.exec(t);if(!o)return;t=o[1];let a=document.createElement("a");if(a.href=t,new URL(a.href).origin===document.location.origin){let s=new Image;s.crossOrigin="anonymous",s.src=t;let g=await L(s);if(g)return g}let r=await f("fetch::asData",[t,{}]),i=new Image;i.crossOrigin="anonymous",i.src=r.data;let c=await L(i);if(c)return c}function ae(e,n="",t=""){let o=e.getContext("2d").getImageData(0,0,e.width,e.height),a=S(e.width,e.height),r=a.getContext("2d");r.putImageData(o,0,0);let i=75,c=75,s=e.width,g=e.height,m=s/g,u=s,p=g;u>i&&(u=i,p=u/m),p>c&&(p=c,u=p*m);function D(b,T,C,O){let h=10,y=O,k,v;if(b.font=`${y}px Arial`,v=b.measureText(T).width,v<=C)return`${y}px Arial`;for(;y-h>.1;)k=(y+h)/2,b.font=`${k}px Arial`,v=b.measureText(T).width,v>C?y=k:h=k;for(;v<C&&h<O;)h+=.1,b.font=`${h.toFixed(1)}px Arial`,v=b.measureText(T).width;return v>C&&(h-=.1),`${h.toFixed(1)}px Arial`}r.font=D(r,t,s,200),r.textBaseline="top";let w=r.measureText(t),fe=w.width,be=w.actualBoundingBoxAscent+w.actualBoundingBoxDescent;r.fillStyle="white",r.fillRect(0,0,fe,be),r.fillStyle="black",r.fillText(t,0,0);let q=a.toDataURL(),A=new Image;A.onload=function(){let b=[`background: url(${q}) no-repeat;`,`padding: ${p}px ${u}px;`,"background-size: contain;","font-size: 1px;"].join(" ");console.log(`%c ${n}`,b)},A.src=q}function xe(e,n,t,o){let a=(o*n+t)*4;return[e[a],e[a+1],e[a+2]]}function ye(e,n){return e.every(t=>t<=n)}function Ce(e,n){return e.every(t=>t>=n)}function ie(e,n=0,t=230,o=.99){let a=e.getContext("2d"),r=a.canvas.width,i=a.canvas.height;if(r===0||i===0)return!0;let c=a.getImageData(0,0,r,i).data,s=0;for(let m=0;m<i;m++)for(let u=0;u<r;u++){let p=xe(c,r,u,m);(ye(p,n)||Ce(p,t))&&s++}return s/(r*i)>o}function re(e,n=500,t=500){let o=e.getContext("2d"),a=o.canvas.width,r=o.canvas.height,i=o.getImageData(0,0,a,r),c=i.width,s=i.height,g=c/s,m=c,u=s;if(m>n&&(m=n,u=Math.floor(m/g)),u>t&&(u=t,m=Math.floor(u*g)),m===c&&u===s)return e;let p=S(c,s);p.getContext("2d").putImageData(i,0,0);let w=S(m,u);return w.getContext("2d").drawImage(p,0,0,c,s,0,0,m,u),w}async function se(e,n){let t={v:x.runtime.getManifest().version,key:ke(e)};return t.url=await f("tab::getURL",[]),t}function ke(e){return!e.keys||!e.keys.length?e.key:e.keys[Math.floor(Math.random()*e.keys.length)]}var P,M=!1;function de(){let e=document.querySelector(".geetest_bg");return!!(e&&e.style.display!=="none"&&e.style["background-image"]!=="none")}function ge(){M=!0,P=new MutationObserver(e=>{e[0].addedNodes.length>0&&ue()}),P.observe(document.querySelector(".geetest_box_wrap"),{childList:!0}),document.querySelector(".geetest_bg")&&ue()}function me(){P.disconnect(),M=!1}function pe(){return M}var ce=!1;async function ue(){if(ce)return;ce=!0;let e;for(;M;){if(document.querySelector(".geetest_box").style.display==="none"){await l(1e3);continue}let t=B(),o=Date.now().valueOf(),a=document.querySelector(".geetest_text_tips")?.textContent;if(!a){e=void 0,await l(1e3);continue}let r=512,i=document.querySelector(".geetest_bg"),c=await Be(r,i);if(!c){e=void 0,await l(1e3);continue}let s=`${a}:${c}`;if(s===e){await l(1e3);continue}e=s;let g=await f("api::recognition",[{type:"hcaptcha_area_select",task:a,image_data:[c],...await se(t)}]);if(!g||"error"in g){document.querySelector(".geetest_refresh")?.click(),await l(3e3);continue}let m=new Date().valueOf();if(t.geetest_solve_delay){let p=t.geetest_solve_delay_time-m+o;p>0&&await l(p)}let u=g.data.x;if(u){let p=parseInt(u);await Me(p),await l(5e3)}else document.querySelector(".geetest_refresh")?.click(),await l(3e3)}}async function Be(e,n){let t=await oe(n);if(t&&(ae(t,"[@nope/geetest]",`${t.width}x${t.height}`),!ie(t)))return e!==null&&(t=re(t,e,e)),ne(t)}function Se(e){for(;e=e.parentElement;)if(e.classList.contains("geetest_box"))return e;console.error("no .geetest_box found")}async function le(e,n,t,o=50){let a=n.left!==void 0?n:n.getBoundingClientRect(),r=t.left!==void 0?t:t.getBoundingClientRect(),[i,c]=[(r.left-a.left)/o,(r.top-a.top)/o];for(let s=0;s<o;s++)e.dispatchEvent(new MouseEvent("mousemove",{clientX:i*s+a.left,clientY:c*s+a.top})),await l(10);await l(50)}async function Me(e){let n=document.querySelector(".geetest_btn"),t=n.getBoundingClientRect(),o=n.parentElement.getBoundingClientRect(),a=.95,r=o.width*a*e/100,i=Se(n);await le(i,{left:500,top:500},t),n.dispatchEvent(new MouseEvent("mousemove",{clientX:t.left+30,clientY:t.top+30})),await l(50),n.dispatchEvent(new MouseEvent("mousedown",{clientX:t.left+30,clientY:t.top+30})),await l(50),await le(n,t,{left:t.left+r,top:t.top}),await l(50);let c=new MouseEvent("mouseup",{clientX:t.left+r,clientY:t.top});n.dispatchEvent(c),i.dispatchEvent(c)}async function Te(){V(),await X(),await f("tab::registerDetectedCaptcha",["geetest"]);let n=new URLSearchParams(location.hash.substring(1)).get("host");E({name:"geetest/auto-open",condition:t=>t.enabled&&t.geetest_auto_open&&!t.disabled_hosts.includes(n),ready:J,start:Z,quit:ee,running:te}),E({name:"geetest/auto-solve",condition:t=>t.enabled&&t.geetest_auto_solve&&!t.disabled_hosts.includes(n),ready:de,start:ge,quit:me,running:pe})}R(Te);})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{var y=chrome;var L="https://api.nopecha.com",m="https://www.nopecha.com",W="https://developers.nopecha.com",Me={doc:{url:W,automation:{url:`${W}/guides/extension_advanced/#automation-build`}},api:{url:L,recognition:{url:`${L}/recognition`},status:{url:`${L}/status`}},www:{url:m,annoucement:{url:`${m}/json/announcement.json`},demo:{url:`${m}/captcha`,recaptcha:{url:`${m}/captcha/recaptcha`},funcaptcha:{url:`${m}/captcha/funcaptcha`},awscaptcha:{url:`${m}/captcha/awscaptcha`},textcaptcha:{url:`${m}/captcha/textcaptcha`},turnstile:{url:`${m}/captcha/turnstile`},perimeterx:{url:`${m}/captcha/perimeterx`},geetest:{url:`${m}/captcha/geetest`},lemincaptcha:{url:`${m}/captcha/lemincaptcha`}},manage:{url:`${m}/manage`},pricing:{url:`${m}/pricing`},setup:{url:`${m}/setup`}},discord:{url:`${m}/discord`},github:{url:`${m}/github`,release:{url:`${m}/github/release`}}};function F(e){let n=("60a8b3778b5b01f87ccc8129cd88bf0f6ec61feb879c88908365771cfcadc232"+e).split("").map(t=>t.charCodeAt(0));return X(n)}var z=new Uint32Array(256);for(let e=256;e--;){let n=e;for(let t=8;t--;)n=n&1?3988292384^n>>>1:n>>>1;z[e]=n}function X(e){let n=-1;for(let t of e)n=n>>>8^z[n&255^t];return(n^-1)>>>0}async function h(e,n){let t=""+[+new Date,performance.now(),Math.random()],[a,c]=await new Promise(i=>{y.runtime.sendMessage([t,e,...n],i)});if(a===F(t))return c}function Y(){let e;return n=>e||(e=n().finally(()=>e=void 0),e)}var he=Y(),_;function K(){return he(async()=>(_||(_=await h("settings::get",[])),_))}function Q(e){_&&(_={..._,...e},j(_))}function $(){return _}function p(e){return new Promise(n=>setTimeout(n,e))}var V=[];function P(e,n){e.timedout=!1,V.push(e);let t,a=setInterval(async()=>{await G(e,$())||(clearTimeout(t),clearInterval(a))},400);n&&(t=setTimeout(()=>clearInterval(a),n),e.timedout=!0)}async function G(e,n){if(e.timedout)return!1;let t=e.condition(n);if(t===e.running())return!1;if(!t&&e.running())return e.quit(),!1;if(t&&!e.running()){for(;!e.ready();)await p(200);return e.start(),!1}}function j(e){V.forEach(n=>G(n,e))}function J(){y.runtime.connect({name:"stream"}).onMessage.addListener(n=>{n.event==="settingsUpdate"&&Q(n.settings)})}function q(e){if(document.readyState!=="loading")setTimeout(e,0);else{let n;n=()=>{removeEventListener("DOMContentLoaded",n),e()},addEventListener("DOMContentLoaded",n)}}var be=(e,n,t)=>new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:n,screenY:t,clientX:n,clientY:t,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});function Z(e,{events:n=null,x:t=null,y:a=null}={}){let c=document.querySelector(e);if(!c)return;if(t===null||a===null){let o=c.getBoundingClientRect();t=o.left+o.width/2,a=o.top+o.height/2}let i=n??["mouseover","mousedown","mouseup","click"];for(let o of i)c.dispatchEvent(be(o,t,a))}var A,D=!1;function ee(){return!!document.querySelector('input[name="lemin_challenge_id"]')}function te(){D=!0;let e=()=>{document.querySelector(".lemin-captcha-input-box").classList.contains("pending")||ve()};A=new MutationObserver(e),A.observe(document.querySelector(".lemin-captcha-input-box"),{attributes:!0,attributeFilter:["class"]}),e()}function ne(){A.disconnect(),D=!1}function oe(){return D}async function ve(){await p(400),Z('span[class="checkmark"]')}function I(e,n){let t=document.createElement("canvas");return t.width=e,t.height=n,t}function ae(e){return e.toDataURL("image/jpeg").replace(/data:image\/[a-z]+;base64,/g,"")}function _e(e){try{e.getContext("2d").getImageData(0,0,1,1)}catch{return!0}return!1}async function O(e,n,t=1e4){if(!n&&!e.complete&&!await new Promise(o=>{let s=setTimeout(()=>{o(!1)},t);e.addEventListener("load",()=>{clearTimeout(s),o(!0)})}))return;let a=I(e.naturalWidth||n?.clientWidth,e.naturalHeight||n?.clientHeight);return a.getContext("2d").drawImage(e,0,0),!_e(a)&&a}async function ie(e){let t=getComputedStyle(e).backgroundImage;if(!t||t==="none")if("src"in e&&e.src)t=`url("${e.src}")`;else return;if("computedStyleMap"in e&&!/url\(["']https?:\/\//.test(t)){let r=e.computedStyleMap().get("background-image");if(r instanceof CSSImageValue){let d=await O(r,e);if(d)return d}}let a=/"(.+)"/.exec(t);if(!a)return;t=a[1];let c=document.createElement("a");if(c.href=t,new URL(c.href).origin===document.location.origin){let r=new Image;r.crossOrigin="anonymous",r.src=t;let d=await O(r);if(d)return d}let i=await h("fetch::asData",[t,{}]),o=new Image;o.crossOrigin="anonymous",o.src=i.data;let s=await O(o);if(s)return s}function re(e,n="",t=""){let a=e.getContext("2d").getImageData(0,0,e.width,e.height),c=I(e.width,e.height),i=c.getContext("2d");i.putImageData(a,0,0);let o=75,s=75,r=e.width,d=e.height,l=r/d,u=r,g=d;u>o&&(u=o,g=u/l),g>s&&(g=s,u=g*l);function C(b,H,k,N){let v=10,B=N,M,w;if(b.font=`${B}px Arial`,w=b.measureText(H).width,w<=k)return`${B}px Arial`;for(;B-v>.1;)M=(B+v)/2,b.font=`${M}px Arial`,w=b.measureText(H).width,w>k?B=M:v=M;for(;w<k&&v<N;)v+=.1,b.font=`${v.toFixed(1)}px Arial`,w=b.measureText(H).width;return w>k&&(v-=.1),`${v.toFixed(1)}px Arial`}i.font=C(i,t,r,200),i.textBaseline="top";let f=i.measureText(t),R=f.width,E=f.actualBoundingBoxAscent+f.actualBoundingBoxDescent;i.fillStyle="white",i.fillRect(0,0,R,E),i.fillStyle="black",i.fillText(t,0,0);let x=c.toDataURL(),S=new Image;S.onload=function(){let b=[`background: url(${x}) no-repeat;`,`padding: ${g}px ${u}px;`,"background-size: contain;","font-size: 1px;"].join(" ");console.log(`%c ${n}`,b)},S.src=x}function we(e,n,t,a){let c=(a*n+t)*4;return[e[c],e[c+1],e[c+2]]}function xe(e,n){return e.every(t=>t<=n)}function ye(e,n){return e.every(t=>t>=n)}function ce(e,n=0,t=230,a=.99){let c=e.getContext("2d"),i=c.canvas.width,o=c.canvas.height;if(i===0||o===0)return!0;let s=c.getImageData(0,0,i,o).data,r=0;for(let l=0;l<o;l++)for(let u=0;u<i;u++){let g=we(s,i,u,l);(xe(g,n)||ye(g,t))&&r++}return r/(i*o)>a}function se(e,n=500,t=500){let a=e.getContext("2d"),c=a.canvas.width,i=a.canvas.height,o=a.getImageData(0,0,c,i),s=o.width,r=o.height,d=s/r,l=s,u=r;if(l>n&&(l=n,u=Math.floor(l/d)),u>t&&(u=t,l=Math.floor(u*d)),l===s&&u===r)return e;let g=I(s,r);g.getContext("2d").putImageData(o,0,0);let f=I(l,u);return f.getContext("2d").drawImage(g,0,0,s,r,0,0,l,u),f}async function ue(e,n){let t={v:y.runtime.getManifest().version,key:Ce(e)};return t.url=await h("tab::getURL",[]),t}function Ce(e){return!e.keys||!e.keys.length?e.key:e.keys[Math.floor(Math.random()*e.keys.length)]}var U,T=!1;function me(){return!!document.querySelector(".lemin-captcha-popup")}function ge(){T=!0,U=new MutationObserver(e=>{e[0].addedNodes.length>0&&de()}),U.observe(document.querySelector(".lemin-captcha-popup"),{childList:!0}),document.querySelector(".lemin-captcha-popup")&&de()}function pe(){U.disconnect(),T=!1}function fe(){return T}var le=!1;async function de(){if(le)return;le=!0;let e;for(;T;){let n=$(),t=Date.now().valueOf(),a=document.querySelector("#lemin-captcha-caption")?.textContent;if(!a){e=void 0,await p(1e3);continue}let c=512,i=document.querySelector(".lemin-captcha-popup").querySelectorAll('img[name*="image"]')?.[0],o=await Se(c,i);if(!o){e=void 0,await p(1e3);continue}let s=`${a}:${o}`;if(s===e){await p(1e3);continue}e=s;let r=await h("api::recognition",[{type:"hcaptcha_area_select",task:a,image_data:[o],...await ue(n)}]);if(!r||"error"in r){document.querySelector(".lemincaptcha_refresh")?.click(),await p(3e3);continue}let d=new Date().valueOf();if(n.lemincaptcha_solve_delay){let u=n.lemincaptcha_solve_delay_time-d+t;u>0&&await p(u)}let l=r.data;l?(await Be({x:parseInt(l.x),y:parseInt(l.y)}),await p(5e3),document.querySelector(".verify-button")?.click()):(document.querySelector(".lemincaptcha_refresh")?.click(),await p(3e3))}}async function Se(e,n){let t=await ie(n);if(t&&(re(t,"[@nope/lemincaptcha]",`${t.width}x${t.height}`),!ce(t)))return e!==null&&(t=se(t,e,e)),ae(t)}function Be({x:e,y:n,duration:t=1e3,framerate:a=60}={}){return new Promise(c=>{let i=document.querySelectorAll('img[name*="image"]'),o=i?.[0]?.parentElement,s=i?.[1]?.parentElement;if(!s||!o)return console.error("Draggable or $target element not found");let r=o.getBoundingClientRect(),d=s.getBoundingClientRect(),l=d.left+window.scrollX,u=d.top+window.scrollY,g=r.left+window.scrollX+r.width*e/100,C=r.top+window.scrollY+r.height*n/100,f=t/1e3*a,R=(g-l)/f,E=(C-u)/f,x=0;function S(){x++<=f&&(s.dispatchEvent(new MouseEvent("mousemove",{clientX:l+R*x,clientY:u+E*x,bubbles:!0})),requestAnimationFrame(S))}s.dispatchEvent(new MouseEvent("mousedown",{clientX:l,clientY:u,bubbles:!0})),requestAnimationFrame(S),setTimeout(()=>{s.dispatchEvent(new MouseEvent("mouseup",{clientX:g,clientY:C,bubbles:!0}))},t),setTimeout(()=>{c(!0)},t+100)})}async function ke(){J(),await K(),await h("tab::registerDetectedCaptcha",["lemincaptcha"]);let n=new URLSearchParams(location.hash.substring(1)).get("host");P({name:"lemincaptcha/auto-open",condition:t=>t.enabled&&t.lemincaptcha_auto_open&&!t.disabled_hosts.includes(n),ready:ee,start:te,quit:ne,running:oe}),P({name:"lemincaptcha/auto-solve",condition:t=>t.enabled&&t.lemincaptcha_auto_solve&&!t.disabled_hosts.includes(n),ready:me,start:ge,quit:pe,running:fe})}q(ke);})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{var u=chrome;var l="https://api.nopecha.com",o="https://www.nopecha.com",b="https://developers.nopecha.com",L={doc:{url:b,automation:{url:`${b}/guides/extension_advanced/#automation-build`}},api:{url:l,recognition:{url:`${l}/recognition`},status:{url:`${l}/status`}},www:{url:o,annoucement:{url:`${o}/json/announcement.json`},demo:{url:`${o}/captcha`,recaptcha:{url:`${o}/captcha/recaptcha`},funcaptcha:{url:`${o}/captcha/funcaptcha`},awscaptcha:{url:`${o}/captcha/awscaptcha`},textcaptcha:{url:`${o}/captcha/textcaptcha`},turnstile:{url:`${o}/captcha/turnstile`},perimeterx:{url:`${o}/captcha/perimeterx`},geetest:{url:`${o}/captcha/geetest`},lemincaptcha:{url:`${o}/captcha/lemincaptcha`}},manage:{url:`${o}/manage`},pricing:{url:`${o}/pricing`},setup:{url:`${o}/setup`}},discord:{url:`${o}/discord`},github:{url:`${o}/github`,release:{url:`${o}/github/release`}}};function h(e){let t=("60a8b3778b5b01f87ccc8129cd88bf0f6ec61feb879c88908365771cfcadc232"+e).split("").map(n=>n.charCodeAt(0));return v(t)}var _=new Uint32Array(256);for(let e=256;e--;){let t=e;for(let n=8;n--;)t=t&1?3988292384^t>>>1:t>>>1;_[e]=t}function v(e){let t=-1;for(let n of e)t=t>>>8^_[t&255^n];return(t^-1)>>>0}async function s(e,t){let n=""+[+new Date,performance.now(),Math.random()],[i,f]=await new Promise(T=>{u.runtime.sendMessage([n,e,...t],T)});if(i===h(n))return f}function w(){let e;return t=>e||(e=t().finally(()=>e=void 0),e)}var k=w(),r;function S(){return k(async()=>(r||(r=await s("settings::get",[])),r))}function x(e){r&&(r={...r,...e},y(r))}function c(){return r}function a(e){return new Promise(t=>setTimeout(t,e))}var $=[];function C(e,t){e.timedout=!1,$.push(e);let n,i=setInterval(async()=>{await B(e,c())||(clearTimeout(n),clearInterval(i))},400);t&&(n=setTimeout(()=>clearInterval(i),t),e.timedout=!0)}async function B(e,t){if(e.timedout)return!1;let n=e.condition(t);if(n===e.running())return!1;if(!n&&e.running())return e.quit(),!1;if(n&&!e.running()){for(;!e.ready();)await a(200);return e.start(),!1}}function y(e){$.forEach(t=>B(t,e))}function M(){u.runtime.connect({name:"stream"}).onMessage.addListener(t=>{t.event==="settingsUpdate"&&x(t.settings)})}function d(e){if(document.readyState!=="loading")setTimeout(e,0);else{let t;t=()=>{removeEventListener("DOMContentLoaded",t),e()},addEventListener("DOMContentLoaded",t)}}var p,m=!1;function P(){return!(!g()||!document.querySelector("[role=button]"))}function q(){m=!0,p=new MutationObserver(()=>{document.querySelector("[role=button]").dispatchEvent(new MouseEvent("mouseup"))}),p.observe(document.querySelector('[aria-label="Human challenge"], [aria-label="Press & Hold"]'),{attributes:!0,attributeFilter:["aria-label"]}),E()}function A(){m=!1,p.disconnect()}function H(){return m}function g(){try{return!!(window.top!==window&&window.top.top===window.top&&[...window.top.document.querySelectorAll("script")].some(e=>e.innerText.includes("_pxAppId"))&&document.querySelector('[aria-label="Human challenge"], [aria-label="Press & Hold"]'))}catch{return!1}}async function E(){let e=c();e.perimeterx_solve_delay&&await a(e.perimeterx_solve_delay_time),document.querySelector("[role=button]").dispatchEvent(new MouseEvent("mousedown"))}async function N(){let e=!1;for(let n=0;n<3;n++)if(await a(1e3),g()){e=!0;break}if(!e)return;M(),await S(),await s("tab::registerDetectedCaptcha",["perimeterx"]);let t=location.hostname;C({name:"perimeterx/auto-solve",condition:n=>n.enabled&&n.perimeterx_auto_solve&&!n.disabled_hosts.includes(t),ready:P,start:q,quit:A,running:H})}d(N);})();
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(()=>{function A(){if("ancestorOrigins"in location){let t=location.ancestorOrigins,n=t[1]??t[0];if(n)return n.split("/")[2]}let e=document.referrer;return e?e.split("/")[2]:location.origin}var b=chrome;var M="https://api.nopecha.com",r="https://www.nopecha.com",D="https://developers.nopecha.com",Be={doc:{url:D,automation:{url:`${D}/guides/extension_advanced/#automation-build`}},api:{url:M,recognition:{url:`${M}/recognition`},status:{url:`${M}/status`}},www:{url:r,annoucement:{url:`${r}/json/announcement.json`},demo:{url:`${r}/captcha`,recaptcha:{url:`${r}/captcha/recaptcha`},funcaptcha:{url:`${r}/captcha/funcaptcha`},awscaptcha:{url:`${r}/captcha/awscaptcha`},textcaptcha:{url:`${r}/captcha/textcaptcha`},turnstile:{url:`${r}/captcha/turnstile`},perimeterx:{url:`${r}/captcha/perimeterx`},geetest:{url:`${r}/captcha/geetest`},lemincaptcha:{url:`${r}/captcha/lemincaptcha`}},manage:{url:`${r}/manage`},pricing:{url:`${r}/pricing`},setup:{url:`${r}/setup`}},discord:{url:`${r}/discord`},github:{url:`${r}/github`,release:{url:`${r}/github/release`}}};function O(e){let t=("60a8b3778b5b01f87ccc8129cd88bf0f6ec61feb879c88908365771cfcadc232"+e).split("").map(n=>n.charCodeAt(0));return V(t)}var q=new Uint32Array(256);for(let e=256;e--;){let t=e;for(let n=8;n--;)t=t&1?3988292384^t>>>1:t>>>1;q[e]=t}function V(e){let t=-1;for(let n of e)t=t>>>8^q[t&255^n];return(t^-1)>>>0}async function d(e,t){let n=""+[+new Date,performance.now(),Math.random()],[o,a]=await new Promise(i=>{b.runtime.sendMessage([n,e,...t],i)});if(o===O(n))return a}function y(){let e;return t=>e||(e=t().finally(()=>e=void 0),e)}var de=y(),p;function N(){return de(async()=>(p||(p=await d("settings::get",[])),p))}function W(e){p&&(p={...p,...e},U(p))}function C(){return p}function l(e){return new Promise(t=>setTimeout(t,e))}var j=[];function E(e,t){e.timedout=!1,j.push(e);let n,o=setInterval(async()=>{await z(e,C())||(clearTimeout(n),clearInterval(o))},400);t&&(n=setTimeout(()=>clearInterval(o),t),e.timedout=!0)}async function z(e,t){if(e.timedout)return!1;let n=e.condition(t);if(n===e.running())return!1;if(!n&&e.running())return e.quit(),!1;if(n&&!e.running()){for(;!e.ready();)await l(200);return e.start(),!1}}function U(e){j.forEach(t=>z(t,e))}function F(){b.runtime.connect({name:"stream"}).onMessage.addListener(t=>{t.event==="settingsUpdate"&&W(t.settings)})}function $(e){if(document.readyState!=="loading")setTimeout(e,0);else{let t;t=()=>{removeEventListener("DOMContentLoaded",t),e()},addEventListener("DOMContentLoaded",t)}}var Xe=y();function J(e){postMessage({source:"nopecha",...e})}function _(e){J(e)}var T,L,H=!1;function Q(){return!!document.querySelector(".recaptcha-checkbox")}function Y(){H=!0,T=new MutationObserver(t=>{t.length===2&&X(),t.length&&t[0].target.classList.contains("recaptcha-checkbox-expired")&&window.location.reload()}),T.observe(document.querySelector(".recaptcha-checkbox"),{attributes:!0});let e=!1;L=new IntersectionObserver(()=>{e||(e=!0,X())},{threshold:0}),L.observe(document.body)}function G(){T.disconnect(),L.disconnect(),H=!1}function K(){return H}async function X(){await l(400),_({action:"click",selector:".recaptcha-checkbox"})}function ge(e,t){let n=document.createElement("canvas");return n.width=e,n.height=t,n}function Z(e){return e.toDataURL("image/jpeg").replace(/data:image\/[a-z]+;base64,/g,"")}function pe(e){try{e.getContext("2d").getImageData(0,0,1,1)}catch{return!0}return!1}async function ee(e,t,n=1e4){if(!t&&!e.complete&&!await new Promise(u=>{let c=setTimeout(()=>{u(!1)},n);e.addEventListener("load",()=>{clearTimeout(c),u(!0)})}))return;let o=ge(e.naturalWidth||t?.clientWidth,e.naturalHeight||t?.clientHeight);return o.getContext("2d").drawImage(e,0,0),!pe(o)&&o}function fe(e,t,n,o){let a=(o*t+n)*4;return[e[a],e[a+1],e[a+2]]}function he(e,t){return e.every(n=>n<=t)}function be(e,t){return e.every(n=>n>=t)}function te(e,t=0,n=230,o=.99){let a=e.getContext("2d"),i=a.canvas.width,u=a.canvas.height;if(i===0||u===0)return!0;let c=a.getImageData(0,0,i,u).data,m=0;for(let v=0;v<u;v++)for(let f=0;f<i;f++){let g=fe(c,i,f,v);(he(g,t)||be(g,n))&&m++}return m/(i*u)>o}function ne(){return[]}function oe(e){return new Promise(t=>{e.push(t)})}function k(e){e.forEach(t=>t()),e.splice(0)}async function ae(e,t){let n={v:b.runtime.getManifest().version,key:_e(e)};return n.url=await d("tab::getURL",[]),n}function _e(e){return!e.keys||!e.keys.length?e.key:e.keys[Math.floor(Math.random()*e.keys.length)]}var ve,S=ne(),R,w=!1;function ie(){return!!document.querySelector(".rc-imageselect, .rc-imageselect-target")}function ce(){w=!0,k(S);let e;R=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>k(S),200)}),R.observe(document.body,{childList:!0,subtree:!0}),ke()}function se(){R.disconnect(),w=!1,k(S)}function le(){return w}function we(){return document.querySelector(".rc-doscaptcha-header")}function xe(){let e=document.querySelector("#recaptcha-verify-button");return e&&e.getAttribute("disabled")}var ye={[1]:1,[0]:3,[2]:4};async function Ce(){for(;;){await l(1e3);let e=document.querySelector(".rc-imageselect-instructions");if(!e)continue;let t=e.innerText.split(`
|
|
2
|
-
`),n=t.slice(0,2).join(" ").replace(/\s+/g," ").trim(),o=[...document.querySelectorAll("table tr td")];if(o.length!==9&&o.length!==16)continue;let a=o.map(c=>c.querySelector("img")).filter(c=>c).filter(c=>c.src.trim());if(a.length!==9&&a.length!==16)continue;let i=o.length===16?2:a.some(c=>c.classList.contains("rc-image-tile-11"))?1:0,u=t.length===3&&i!==2;return{task:n,type:i,cells:o,images:a,waitAfterSolve:u}}}var re=!1;async function ke(){if(!re){for(re=!0;w&&(we()||xe());)await l(1e3);for(;w;){let{task:e,type:t,cells:n,images:o,waitAfterSolve:a}=await Ce(),i=C(),u=new Date().valueOf(),c=[...n];t!==1&&(o=[o[0]]);let m=await Promise.all(o.map(s=>ee(s)));if(t===1){let s=[],x=[];for(let[B,h]of m.entries())h.width!==100||h.height!==100||(s.push(c[B]),x.push(h));c=s,m=x}if(m.length===0){_({action:"click",selector:"#recaptcha-verify-button"}),await l(3e3);continue}let I=!1;for(let s of m)if(te(s)){I=!0;break}if(I){await l(3e3);continue}let v=m.map(Z),f=ye[t],g=await d("api::recognition",[{type:"recaptcha",task:e,image_data:v,grid:[f,f].join("x"),...await ae(i)}]);if(!g||"error"in g){console.warn(`[@nope/recaptcha/${ve}]`,"api error",g),await l(2e3);continue}let ue=new Date().valueOf();if(i.recaptcha_solve_delay){let s=i.recaptcha_solve_delay_time-ue+u;s>0&&await l(s)}let P=t===2?4:3;for(c.forEach((s,x)=>{let B=s.classList.contains("rc-imageselect-tileselected"),h=n.indexOf(s);g.data[x]!==B&&_({action:"click",selector:`tr:nth-child(${Math.floor(h/P)+1}) td:nth-child(${h%P+1})`})}),(!a||!g.data.some(s=>s))&&(await l(200),_({action:"click",selector:"#recaptcha-verify-button"})),await oe(S);document.querySelectorAll(".rc-imageselect-dynamic-selected").length>0;)await l(1e3)}}}async function Se(){F(),await N(),await d("tab::registerDetectedCaptcha",["recaptcha"]);let e=A();location.pathname.endsWith("/anchor")?E({name:"recaptcha/auto-open",condition:t=>t.enabled&&t.recaptcha_auto_open&&!t.disabled_hosts.includes(e),ready:Q,start:Y,quit:G,running:K}):E({name:"recaptcha/auto-solve",condition:t=>t.enabled&&t.recaptcha_auto_solve&&!t.disabled_hosts.includes(e),ready:ie,start:ce,quit:se,running:le})}$(Se);})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{var f=chrome;var y="https://api.nopecha.com",i="https://www.nopecha.com",B="https://developers.nopecha.com",ie={doc:{url:B,automation:{url:`${B}/guides/extension_advanced/#automation-build`}},api:{url:y,recognition:{url:`${y}/recognition`},status:{url:`${y}/status`}},www:{url:i,annoucement:{url:`${i}/json/announcement.json`},demo:{url:`${i}/captcha`,recaptcha:{url:`${i}/captcha/recaptcha`},funcaptcha:{url:`${i}/captcha/funcaptcha`},awscaptcha:{url:`${i}/captcha/awscaptcha`},textcaptcha:{url:`${i}/captcha/textcaptcha`},turnstile:{url:`${i}/captcha/turnstile`},perimeterx:{url:`${i}/captcha/perimeterx`},geetest:{url:`${i}/captcha/geetest`},lemincaptcha:{url:`${i}/captcha/lemincaptcha`}},manage:{url:`${i}/manage`},pricing:{url:`${i}/pricing`},setup:{url:`${i}/setup`}},discord:{url:`${i}/discord`},github:{url:`${i}/github`,release:{url:`${i}/github/release`}}};function M(e){let t=("60a8b3778b5b01f87ccc8129cd88bf0f6ec61feb879c88908365771cfcadc232"+e).split("").map(n=>n.charCodeAt(0));return I(t)}var T=new Uint32Array(256);for(let e=256;e--;){let t=e;for(let n=8;n--;)t=t&1?3988292384^t>>>1:t>>>1;T[e]=t}function I(e){let t=-1;for(let n of e)t=t>>>8^T[t&255^n];return(t^-1)>>>0}async function d(e,t){let n=""+[+new Date,performance.now(),Math.random()],[a,o]=await new Promise(c=>{f.runtime.sendMessage([n,e,...t],c)});if(a===M(n))return o}function $(){let e;return t=>e||(e=t().finally(()=>e=void 0),e)}var G=$(),m;function H(){return G(async()=>(m||(m=await d("settings::get",[])),m))}function E(e){m&&(m={...m,...e},L(m))}function h(){return m}function r(e){return new Promise(t=>setTimeout(t,e))}var P=[];function D(e,t){e.timedout=!1,P.push(e);let n,a=setInterval(async()=>{await R(e,h())||(clearTimeout(n),clearInterval(a))},400);t&&(n=setTimeout(()=>clearInterval(a),t),e.timedout=!0)}async function R(e,t){if(e.timedout)return!1;let n=e.condition(t);if(n===e.running())return!1;if(!n&&e.running())return e.quit(),!1;if(n&&!e.running()){for(;!e.ready();)await r(200);return e.start(),!1}}function L(e){P.forEach(t=>R(t,e))}function A(){f.runtime.connect({name:"stream"}).onMessage.addListener(t=>{t.event==="settingsUpdate"&&E(t.settings)})}function C(e){if(document.readyState!=="loading")setTimeout(e,0);else{let t;t=()=>{removeEventListener("DOMContentLoaded",t),e()},addEventListener("DOMContentLoaded",t)}}function J(e,t){let n=document.createElement("canvas");return n.width=e,n.height=t,n}function q(e){return e.toDataURL("image/jpeg").replace(/data:image\/[a-z]+;base64,/g,"")}function X(e){try{e.getContext("2d").getImageData(0,0,1,1)}catch{return!0}return!1}async function b(e,t,n=1e4){if(!t&&!e.complete&&!await new Promise(s=>{let u=setTimeout(()=>{s(!1)},n);e.addEventListener("load",()=>{clearTimeout(u),s(!0)})}))return;let a=J(e.naturalWidth||t?.clientWidth,e.naturalHeight||t?.clientHeight);return a.getContext("2d").drawImage(e,0,0),!X(a)&&a}async function U(e){let n=getComputedStyle(e).backgroundImage;if(!n||n==="none")if("src"in e&&e.src)n=`url("${e.src}")`;else return;if("computedStyleMap"in e&&!/url\(["']https?:\/\//.test(n)){let l=e.computedStyleMap().get("background-image");if(l instanceof CSSImageValue){let g=await b(l,e);if(g)return g}}let a=/"(.+)"/.exec(n);if(!a)return;n=a[1];let o=document.createElement("a");if(o.href=n,new URL(o.href).origin===document.location.origin){let l=new Image;l.crossOrigin="anonymous",l.src=n;let g=await b(l);if(g)return g}let c=await d("fetch::asData",[n,{}]),s=new Image;s.crossOrigin="anonymous",s.src=c.data;let u=await b(s);if(u)return u}function Y(e,t,n,a){let o=(a*t+n)*4;return[e[o],e[o+1],e[o+2]]}function Z(e,t){return e.every(n=>n<=t)}function ee(e,t){return e.every(n=>n>=t)}function N(e,t=0,n=230,a=.99){let o=e.getContext("2d"),c=o.canvas.width,s=o.canvas.height;if(c===0||s===0)return!0;let u=o.getImageData(0,0,c,s).data,l=0;for(let p=0;p<s;p++)for(let x=0;x<c;x++){let k=Y(u,c,x,p);(Z(k,t)||ee(k,n))&&l++}return l/(c*s)>a}function W(){return[]}function O(e){return new Promise(t=>{e.push(t)})}function v(e){e.forEach(t=>t()),e.splice(0)}async function z(e,t){let n={v:f.runtime.getManifest().version,key:te(e)};return n.url=await d("tab::getURL",[]),n}function te(e){return!e.keys||!e.keys.length?e.key:e.keys[Math.floor(Math.random()*e.keys.length)]}var _=W(),S,w=!1;function j(){let e=h(),t=document.querySelector(e.textcaptcha_image_selector),n=document.querySelector(e.textcaptcha_input_selector);return!t||!n?!1:(d("tab::registerDetectedCaptcha",["textcaptcha"]),!0)}function V(){w=!0,v(_),S=new MutationObserver(()=>{setTimeout(()=>v(_),200)}),S.observe(document.body,{subtree:!0,childList:!0,attributes:!0}),ae()}function K(){S.disconnect(),w=!1,v(_)}function Q(){return w}async function ne(e){if(e instanceof HTMLCanvasElement)return e;if(e instanceof HTMLImageElement&&(e.src||e.srcset)){let t=await b(e);if(t)return t}return await U(e)}var F=!1;async function ae(){if(F)return;F=!0;let e;for(;w;){let t=h(),n=document.querySelector(t.textcaptcha_image_selector),a=document.querySelector(t.textcaptcha_input_selector);if(!n){await r(500);continue}if(!a){await r(500);continue}if(a.click(),a.focus(),await r(200),a.value!==""){await r(500);continue}let o=await ne(n);if(!o){await r(500);continue}if(N(o)){await r(500);continue}let c=q(o);if(e===c){await r(500);continue}e=c;let s=new Date().valueOf(),u=await d("api::recognition",[{type:"textcaptcha",image_data:[c],...await z(t)}]);if(!u||"error"in u){console.warn("[@nope/textcaptcha] api error",u),await r(2e3);continue}let l=new Date().valueOf();if(t.textcaptcha_solve_delay){let g=t.textcaptcha_solve_delay_time-l+s;g>0&&await r(g)}if(u.data&&u.data.length>0&&!a.value){a.click(),a.focus(),await r(200),Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set.call(a,u.data[0]);for(let p of u.data[0])a.dispatchEvent(new KeyboardEvent("keydown",{key:p,bubbles:!0})),await r(15),a.dispatchEvent(new KeyboardEvent("keypress",{key:p,bubbles:!0})),await r(10),a.dispatchEvent(new KeyboardEvent("keyup",{key:p,bubbles:!0})),await r(15);a.dispatchEvent(new Event("input",{bubbles:!0})),a.dispatchEvent(new Event("change",{bubbles:!0}))}await O(_)}}async function oe(){A(),await H(),await d("tab::registerDetectedCaptcha",["textcaptcha"]);let e=location.hostname;D({name:"textcaptcha/auto-solve",condition:t=>t.enabled&&t.textcaptcha_auto_solve&&!t.disabled_hosts.includes(e)&&!!t.textcaptcha_image_selector&&!!t.textcaptcha_input_selector,ready:j,start:V,quit:K,running:Q})}C(oe);})();
|