@skrillex1224/playwright-toolkit 2.1.220 → 2.1.221
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/dist/index.cjs +375 -326
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +375 -326
- package/dist/index.js.map +4 -4
- package/index.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -361,18 +361,18 @@ var fallbackLog = {
|
|
|
361
361
|
error: (...args) => console.error(...args),
|
|
362
362
|
debug: (...args) => console.debug ? console.debug(...args) : console.log(...args)
|
|
363
363
|
};
|
|
364
|
-
var resolveLogMethod = (
|
|
365
|
-
if (
|
|
366
|
-
return
|
|
364
|
+
var resolveLogMethod = (logger14, name) => {
|
|
365
|
+
if (logger14 && typeof logger14[name] === "function") {
|
|
366
|
+
return logger14[name].bind(logger14);
|
|
367
367
|
}
|
|
368
|
-
if (name === "warning" &&
|
|
369
|
-
return
|
|
368
|
+
if (name === "warning" && logger14 && typeof logger14.warn === "function") {
|
|
369
|
+
return logger14.warn.bind(logger14);
|
|
370
370
|
}
|
|
371
371
|
return fallbackLog[name];
|
|
372
372
|
};
|
|
373
373
|
var defaultLogger = null;
|
|
374
|
-
var setDefaultLogger = (
|
|
375
|
-
defaultLogger =
|
|
374
|
+
var setDefaultLogger = (logger14) => {
|
|
375
|
+
defaultLogger = logger14;
|
|
376
376
|
};
|
|
377
377
|
var resolveLogger = (explicitLogger) => {
|
|
378
378
|
if (explicitLogger && typeof explicitLogger.info === "function") {
|
|
@@ -399,8 +399,8 @@ var colorize = (text, color) => {
|
|
|
399
399
|
var createBaseLogger = (prefix = "", explicitLogger) => {
|
|
400
400
|
const name = prefix ? String(prefix) : "";
|
|
401
401
|
const dispatch = (methodName, icon, message, color) => {
|
|
402
|
-
const
|
|
403
|
-
const logFn = resolveLogMethod(
|
|
402
|
+
const logger14 = resolveLogger(explicitLogger);
|
|
403
|
+
const logFn = resolveLogMethod(logger14, methodName);
|
|
404
404
|
const timestamp = colorize(`[${formatTimestamp()}]`, ANSI.gray);
|
|
405
405
|
const line = formatLine(name, icon, message);
|
|
406
406
|
const coloredLine = colorize(line, color);
|
|
@@ -2976,13 +2976,91 @@ var LiveView = {
|
|
|
2976
2976
|
useLiveView
|
|
2977
2977
|
};
|
|
2978
2978
|
|
|
2979
|
-
// src/
|
|
2979
|
+
// src/chaptcha.js
|
|
2980
2980
|
var import_uuid = require("uuid");
|
|
2981
|
+
|
|
2982
|
+
// src/internals/captcha/shared.js
|
|
2983
|
+
var waitForVisible = async (locator, timeout) => {
|
|
2984
|
+
try {
|
|
2985
|
+
await locator.waitFor({
|
|
2986
|
+
state: "visible",
|
|
2987
|
+
timeout
|
|
2988
|
+
});
|
|
2989
|
+
return true;
|
|
2990
|
+
} catch {
|
|
2991
|
+
return false;
|
|
2992
|
+
}
|
|
2993
|
+
};
|
|
2994
|
+
var isAnyCaptchaTextVisible = async (frame, texts, timeout) => {
|
|
2995
|
+
for (const text of texts || []) {
|
|
2996
|
+
if (!text) {
|
|
2997
|
+
continue;
|
|
2998
|
+
}
|
|
2999
|
+
const candidates = [
|
|
3000
|
+
frame.getByText(text, { exact: false }).first(),
|
|
3001
|
+
frame.locator(`text=${text}`).first()
|
|
3002
|
+
];
|
|
3003
|
+
for (const candidate of candidates) {
|
|
3004
|
+
const isVisible = await candidate.isVisible({ timeout }).catch(() => false);
|
|
3005
|
+
if (isVisible) {
|
|
3006
|
+
return true;
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
return false;
|
|
3011
|
+
};
|
|
3012
|
+
var clickCaptchaAction = async (frame, texts, options) => {
|
|
3013
|
+
for (const text of texts || []) {
|
|
3014
|
+
const candidates = [
|
|
3015
|
+
frame.getByText(text, { exact: false }).first(),
|
|
3016
|
+
frame.locator(`text=${text}`).first()
|
|
3017
|
+
];
|
|
3018
|
+
for (const candidate of candidates) {
|
|
3019
|
+
const isVisible = await waitForVisible(candidate, options.actionVisibleTimeoutMs);
|
|
3020
|
+
if (!isVisible) {
|
|
3021
|
+
continue;
|
|
3022
|
+
}
|
|
3023
|
+
await candidate.click();
|
|
3024
|
+
return true;
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
return false;
|
|
3028
|
+
};
|
|
3029
|
+
var dragCaptchaWithMouse = async (page, sourceLocator, targetLocator) => {
|
|
3030
|
+
const sourceBox = await sourceLocator.boundingBox();
|
|
3031
|
+
const targetBox = await targetLocator.boundingBox();
|
|
3032
|
+
if (!sourceBox || !targetBox) {
|
|
3033
|
+
throw new Error("Unable to resolve captcha drag coordinates.");
|
|
3034
|
+
}
|
|
3035
|
+
const startX = sourceBox.x + sourceBox.width / 2;
|
|
3036
|
+
const startY = sourceBox.y + sourceBox.height / 2;
|
|
3037
|
+
const endX = targetBox.x + targetBox.width / 2;
|
|
3038
|
+
const endY = targetBox.y + targetBox.height / 2;
|
|
3039
|
+
const steps = 10;
|
|
3040
|
+
const liftOffsetX = Math.min(18, Math.max(8, sourceBox.width * 0.12));
|
|
3041
|
+
const liftOffsetY = Math.min(12, Math.max(4, sourceBox.height * 0.08));
|
|
3042
|
+
await page.mouse.move(startX, startY, { steps: 8 });
|
|
3043
|
+
await page.waitForTimeout(250);
|
|
3044
|
+
await page.mouse.down();
|
|
3045
|
+
await page.waitForTimeout(350);
|
|
3046
|
+
await page.mouse.move(startX + liftOffsetX, startY + liftOffsetY, { steps: 6 });
|
|
3047
|
+
await page.waitForTimeout(250);
|
|
3048
|
+
for (let step = 1; step <= steps; step++) {
|
|
3049
|
+
const progress = step / steps;
|
|
3050
|
+
const easedProgress = 1 - (1 - progress) * (1 - progress);
|
|
3051
|
+
const currentX = startX + liftOffsetX + (endX - startX - liftOffsetX) * easedProgress;
|
|
3052
|
+
const currentY = startY + liftOffsetY + (endY - startY - liftOffsetY) * easedProgress;
|
|
3053
|
+
await page.mouse.move(currentX, currentY, { steps: 2 });
|
|
3054
|
+
await page.waitForTimeout(90);
|
|
3055
|
+
}
|
|
3056
|
+
await page.waitForTimeout(100);
|
|
3057
|
+
await page.mouse.up();
|
|
3058
|
+
await page.waitForTimeout(100);
|
|
3059
|
+
};
|
|
3060
|
+
|
|
3061
|
+
// src/internals/captcha/bytedance.js
|
|
2981
3062
|
var logger9 = createInternalLogger("Captcha");
|
|
2982
|
-
var DEFAULT_BYTEDANCE_CAPTCHA_TOKEN = "eKJvBfwfN0YRav0-VD_44E2VBSfm7l0YtddUQ7cFySI";
|
|
2983
3063
|
var DEFAULT_BYTEDANCE_CAPTCHA_OPTIONS = Object.freeze({
|
|
2984
|
-
token: DEFAULT_BYTEDANCE_CAPTCHA_TOKEN,
|
|
2985
|
-
apiUrl: "https://api.jfbym.com/api/YmServer/customApi",
|
|
2986
3064
|
apiType: "31234",
|
|
2987
3065
|
maxRetries: 3,
|
|
2988
3066
|
containerSelector: "#captcha_container",
|
|
@@ -3019,128 +3097,6 @@ var DEFAULT_BYTEDANCE_CAPTCHA_OPTIONS = Object.freeze({
|
|
|
3019
3097
|
retryDelayBaseMs: 2e3,
|
|
3020
3098
|
retryDelayStepMs: 1e3
|
|
3021
3099
|
});
|
|
3022
|
-
function useCaptchaMonitor(page, options) {
|
|
3023
|
-
const { domSelector, urlPattern, onDetected } = options;
|
|
3024
|
-
if (!domSelector && !urlPattern) {
|
|
3025
|
-
throw new Error("[CaptchaMonitor] \u5FC5\u987B\u63D0\u4F9B domSelector \u6216 urlPattern\u3002");
|
|
3026
|
-
}
|
|
3027
|
-
if (!onDetected || typeof onDetected !== "function") {
|
|
3028
|
-
throw new Error("[CaptchaMonitor] onDetected \u5FC5\u987B\u662F\u51FD\u6570\u3002");
|
|
3029
|
-
}
|
|
3030
|
-
let isStopped = false;
|
|
3031
|
-
let isHandling = false;
|
|
3032
|
-
let frameHandler = null;
|
|
3033
|
-
let exposedFunctionName = null;
|
|
3034
|
-
const triggerDetected = async () => {
|
|
3035
|
-
if (isStopped || isHandling) return;
|
|
3036
|
-
isHandling = true;
|
|
3037
|
-
try {
|
|
3038
|
-
await onDetected();
|
|
3039
|
-
} finally {
|
|
3040
|
-
isHandling = false;
|
|
3041
|
-
}
|
|
3042
|
-
};
|
|
3043
|
-
const cleanupFns = [];
|
|
3044
|
-
if (domSelector) {
|
|
3045
|
-
exposedFunctionName = `__c_d_${(0, import_uuid.v4)().replace(/-/g, "_")}`;
|
|
3046
|
-
const cleanerName = `__c_cleaner_${(0, import_uuid.v4)().replace(/-/g, "_")}`;
|
|
3047
|
-
page.exposeFunction(exposedFunctionName, triggerDetected).catch(() => {
|
|
3048
|
-
});
|
|
3049
|
-
page.addInitScript(({ selector, callbackName, cleanerName: cleanupName }) => {
|
|
3050
|
-
(() => {
|
|
3051
|
-
let observer = null;
|
|
3052
|
-
const checkAndReport = () => {
|
|
3053
|
-
const element = document.querySelector(selector);
|
|
3054
|
-
if (!element) {
|
|
3055
|
-
return false;
|
|
3056
|
-
}
|
|
3057
|
-
if (window[callbackName]) {
|
|
3058
|
-
window[callbackName]();
|
|
3059
|
-
}
|
|
3060
|
-
return true;
|
|
3061
|
-
};
|
|
3062
|
-
checkAndReport();
|
|
3063
|
-
observer = new MutationObserver((mutations) => {
|
|
3064
|
-
const shouldCheck = mutations.some((mutation) => mutation.addedNodes.length > 0);
|
|
3065
|
-
if (shouldCheck && observer) {
|
|
3066
|
-
checkAndReport();
|
|
3067
|
-
}
|
|
3068
|
-
});
|
|
3069
|
-
const mountObserver = () => {
|
|
3070
|
-
const target = document.documentElement;
|
|
3071
|
-
if (target && observer) {
|
|
3072
|
-
observer.observe(target, { childList: true, subtree: true });
|
|
3073
|
-
}
|
|
3074
|
-
};
|
|
3075
|
-
if (document.readyState === "loading") {
|
|
3076
|
-
window.addEventListener("DOMContentLoaded", mountObserver);
|
|
3077
|
-
} else {
|
|
3078
|
-
mountObserver();
|
|
3079
|
-
}
|
|
3080
|
-
window[cleanupName] = () => {
|
|
3081
|
-
if (observer) {
|
|
3082
|
-
observer.disconnect();
|
|
3083
|
-
observer = null;
|
|
3084
|
-
}
|
|
3085
|
-
};
|
|
3086
|
-
})();
|
|
3087
|
-
}, { selector: domSelector, callbackName: exposedFunctionName, cleanerName });
|
|
3088
|
-
logger9.success("useCaptchaMonitor", `DOM \u76D1\u63A7\u5DF2\u542F\u7528\uFF1A${domSelector}`);
|
|
3089
|
-
cleanupFns.push(async () => {
|
|
3090
|
-
try {
|
|
3091
|
-
await page.evaluate((name) => {
|
|
3092
|
-
if (window[name]) {
|
|
3093
|
-
window[name]();
|
|
3094
|
-
delete window[name];
|
|
3095
|
-
}
|
|
3096
|
-
}, cleanerName);
|
|
3097
|
-
} catch {
|
|
3098
|
-
}
|
|
3099
|
-
});
|
|
3100
|
-
}
|
|
3101
|
-
if (urlPattern) {
|
|
3102
|
-
frameHandler = async (frame) => {
|
|
3103
|
-
if (frame !== page.mainFrame()) {
|
|
3104
|
-
return;
|
|
3105
|
-
}
|
|
3106
|
-
const currentUrl = page.url();
|
|
3107
|
-
if (currentUrl.includes(urlPattern)) {
|
|
3108
|
-
await triggerDetected();
|
|
3109
|
-
}
|
|
3110
|
-
};
|
|
3111
|
-
page.on("framenavigated", frameHandler);
|
|
3112
|
-
logger9.success("useCaptchaMonitor", `URL \u76D1\u63A7\u5DF2\u542F\u7528\uFF1A${urlPattern}`);
|
|
3113
|
-
cleanupFns.push(async () => {
|
|
3114
|
-
page.off("framenavigated", frameHandler);
|
|
3115
|
-
});
|
|
3116
|
-
}
|
|
3117
|
-
return {
|
|
3118
|
-
stop: async () => {
|
|
3119
|
-
logger9.info("\u6B63\u5728\u505C\u6B62\u9A8C\u8BC1\u7801\u76D1\u63A7...");
|
|
3120
|
-
for (const fn of cleanupFns) {
|
|
3121
|
-
await fn();
|
|
3122
|
-
}
|
|
3123
|
-
isStopped = true;
|
|
3124
|
-
}
|
|
3125
|
-
};
|
|
3126
|
-
}
|
|
3127
|
-
var callCaptchaRecognitionApi = async (imageBase64, { apiUrl, apiType, token }) => {
|
|
3128
|
-
const response = await fetch(apiUrl, {
|
|
3129
|
-
method: "POST",
|
|
3130
|
-
headers: {
|
|
3131
|
-
"Content-Type": "application/json"
|
|
3132
|
-
},
|
|
3133
|
-
body: JSON.stringify({
|
|
3134
|
-
type: apiType,
|
|
3135
|
-
image: imageBase64,
|
|
3136
|
-
token
|
|
3137
|
-
})
|
|
3138
|
-
});
|
|
3139
|
-
if (!response.ok) {
|
|
3140
|
-
throw new Error(`Captcha API request failed with status ${response.status}`);
|
|
3141
|
-
}
|
|
3142
|
-
return await response.json();
|
|
3143
|
-
};
|
|
3144
3100
|
var extractCaptchaSerialNumbers = (apiResponse) => {
|
|
3145
3101
|
const serialNumbers = apiResponse?.data?.data?.serial_number;
|
|
3146
3102
|
if (!Array.isArray(serialNumbers)) {
|
|
@@ -3148,76 +3104,6 @@ var extractCaptchaSerialNumbers = (apiResponse) => {
|
|
|
3148
3104
|
}
|
|
3149
3105
|
return serialNumbers.map((value) => Number(value)).filter((value) => Number.isInteger(value) && value >= 0);
|
|
3150
3106
|
};
|
|
3151
|
-
var waitForVisible = async (locator, timeout) => {
|
|
3152
|
-
try {
|
|
3153
|
-
await locator.waitFor({
|
|
3154
|
-
state: "visible",
|
|
3155
|
-
timeout
|
|
3156
|
-
});
|
|
3157
|
-
return true;
|
|
3158
|
-
} catch {
|
|
3159
|
-
return false;
|
|
3160
|
-
}
|
|
3161
|
-
};
|
|
3162
|
-
var isAnyCaptchaTextVisible = async (frame, texts, timeout) => {
|
|
3163
|
-
for (const text of texts || []) {
|
|
3164
|
-
if (!text) {
|
|
3165
|
-
continue;
|
|
3166
|
-
}
|
|
3167
|
-
const candidates = [
|
|
3168
|
-
frame.getByText(text, { exact: false }).first(),
|
|
3169
|
-
frame.locator(`text=${text}`).first()
|
|
3170
|
-
];
|
|
3171
|
-
for (const candidate of candidates) {
|
|
3172
|
-
const isVisible = await candidate.isVisible({ timeout }).catch(() => false);
|
|
3173
|
-
if (isVisible) {
|
|
3174
|
-
return true;
|
|
3175
|
-
}
|
|
3176
|
-
}
|
|
3177
|
-
}
|
|
3178
|
-
return false;
|
|
3179
|
-
};
|
|
3180
|
-
var waitForCaptchaChallengeReady = async (page, frame, options) => {
|
|
3181
|
-
const deadline = Date.now() + options.challengeReadyTimeoutMs;
|
|
3182
|
-
let refreshDeadline = Date.now() + options.challengeReadyRefreshTimeoutMs;
|
|
3183
|
-
let hasSeenLoading = false;
|
|
3184
|
-
while (Date.now() < deadline) {
|
|
3185
|
-
const isLoadingVisible = await isAnyCaptchaTextVisible(
|
|
3186
|
-
frame,
|
|
3187
|
-
options.loadingTexts,
|
|
3188
|
-
options.loadingIndicatorVisibleTimeoutMs
|
|
3189
|
-
);
|
|
3190
|
-
const hasErrorTextVisible = await isAnyCaptchaTextVisible(
|
|
3191
|
-
frame,
|
|
3192
|
-
options.errorTexts,
|
|
3193
|
-
options.loadingIndicatorVisibleTimeoutMs
|
|
3194
|
-
);
|
|
3195
|
-
hasSeenLoading = hasSeenLoading || isLoadingVisible;
|
|
3196
|
-
const sourceImages = frame.locator(options.sourceImageSelector);
|
|
3197
|
-
const imageCount = await sourceImages.count().catch(() => 0);
|
|
3198
|
-
const hasVisibleSourceImage = imageCount > 0 ? await sourceImages.first().isVisible({ timeout: options.loadingIndicatorVisibleTimeoutMs }).catch(() => false) : false;
|
|
3199
|
-
if (!isLoadingVisible && hasVisibleSourceImage) {
|
|
3200
|
-
logger9.info(hasSeenLoading ? "\u9A8C\u8BC1\u7801\u56FE\u7247\u5DF2\u52A0\u8F7D\u5B8C\u6210\u3002" : "\u9A8C\u8BC1\u7801\u56FE\u7247\u5DF2\u5C31\u7EEA\u3002");
|
|
3201
|
-
return;
|
|
3202
|
-
}
|
|
3203
|
-
if (hasErrorTextVisible) {
|
|
3204
|
-
logger9.warn("\u9A8C\u8BC1\u7801\u9762\u677F\u51FA\u73B0\u7F51\u7EDC\u5F02\u5E38\u6587\u6848\uFF0C\u5C1D\u8BD5\u7ACB\u5373\u5237\u65B0\u9898\u76EE\u3002");
|
|
3205
|
-
await refreshCaptcha(page, frame, options);
|
|
3206
|
-
refreshDeadline = Date.now() + options.challengeReadyRefreshTimeoutMs;
|
|
3207
|
-
hasSeenLoading = false;
|
|
3208
|
-
continue;
|
|
3209
|
-
}
|
|
3210
|
-
if (!hasVisibleSourceImage && Date.now() >= refreshDeadline) {
|
|
3211
|
-
logger9.warn(`\u9A8C\u8BC1\u7801\u56FE\u7247\u8D85\u8FC7 ${options.challengeReadyRefreshTimeoutMs}ms \u4ECD\u672A\u51FA\u73B0\uFF0C\u5C1D\u8BD5\u5237\u65B0\u9898\u76EE\u3002`);
|
|
3212
|
-
await refreshCaptcha(page, frame, options);
|
|
3213
|
-
refreshDeadline = Date.now() + options.challengeReadyRefreshTimeoutMs;
|
|
3214
|
-
hasSeenLoading = false;
|
|
3215
|
-
continue;
|
|
3216
|
-
}
|
|
3217
|
-
await page.waitForTimeout(options.challengeReadyPollMs);
|
|
3218
|
-
}
|
|
3219
|
-
throw new Error("Captcha challenge is still loading and did not become ready in time.");
|
|
3220
|
-
};
|
|
3221
3107
|
var resolveContentFrame = async (page, iframeLocator, options) => {
|
|
3222
3108
|
for (let attempt = 1; attempt <= options.contentFrameResolveRetries; attempt++) {
|
|
3223
3109
|
const iframeHandle = await iframeLocator.elementHandle();
|
|
@@ -3264,22 +3150,14 @@ var getVerifycenterCaptchaContext = async (page, options) => {
|
|
|
3264
3150
|
}
|
|
3265
3151
|
return { iframeLocator, frame };
|
|
3266
3152
|
};
|
|
3267
|
-
var
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
];
|
|
3273
|
-
for (const candidate of candidates) {
|
|
3274
|
-
const isVisible = await waitForVisible(candidate, options.actionVisibleTimeoutMs);
|
|
3275
|
-
if (!isVisible) {
|
|
3276
|
-
continue;
|
|
3277
|
-
}
|
|
3278
|
-
await candidate.click();
|
|
3279
|
-
return true;
|
|
3280
|
-
}
|
|
3153
|
+
var refreshCaptcha = async (page, frame, options) => {
|
|
3154
|
+
const clicked = await clickCaptchaAction(frame, options.refreshTexts, options).catch(() => false);
|
|
3155
|
+
if (!clicked) {
|
|
3156
|
+
logger9.warn("Refresh button not found.");
|
|
3157
|
+
return false;
|
|
3281
3158
|
}
|
|
3282
|
-
|
|
3159
|
+
await page.waitForTimeout(options.refreshWaitMs);
|
|
3160
|
+
return true;
|
|
3283
3161
|
};
|
|
3284
3162
|
var findCaptchaDropTarget = async (frame, options) => {
|
|
3285
3163
|
for (const text of options.dropTargetTexts) {
|
|
@@ -3296,47 +3174,52 @@ var findCaptchaDropTarget = async (frame, options) => {
|
|
|
3296
3174
|
}
|
|
3297
3175
|
return null;
|
|
3298
3176
|
};
|
|
3299
|
-
var
|
|
3300
|
-
const
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3177
|
+
var waitForCaptchaChallengeReady = async (page, frame, options) => {
|
|
3178
|
+
const deadline = Date.now() + options.challengeReadyTimeoutMs;
|
|
3179
|
+
let refreshDeadline = Date.now() + options.challengeReadyRefreshTimeoutMs;
|
|
3180
|
+
let hasSeenLoading = false;
|
|
3181
|
+
while (Date.now() < deadline) {
|
|
3182
|
+
const isLoadingVisible = await isAnyCaptchaTextVisible(
|
|
3183
|
+
frame,
|
|
3184
|
+
options.loadingTexts,
|
|
3185
|
+
options.loadingIndicatorVisibleTimeoutMs
|
|
3186
|
+
);
|
|
3187
|
+
const hasErrorTextVisible = await isAnyCaptchaTextVisible(
|
|
3188
|
+
frame,
|
|
3189
|
+
options.errorTexts,
|
|
3190
|
+
options.loadingIndicatorVisibleTimeoutMs
|
|
3191
|
+
);
|
|
3192
|
+
hasSeenLoading = hasSeenLoading || isLoadingVisible;
|
|
3193
|
+
const sourceImages = frame.locator(options.sourceImageSelector);
|
|
3194
|
+
const imageCount = await sourceImages.count().catch(() => 0);
|
|
3195
|
+
const hasVisibleSourceImage = imageCount > 0 ? await sourceImages.first().isVisible({ timeout: options.loadingIndicatorVisibleTimeoutMs }).catch(() => false) : false;
|
|
3196
|
+
if (!isLoadingVisible && hasVisibleSourceImage) {
|
|
3197
|
+
logger9.info(hasSeenLoading ? "\u9A8C\u8BC1\u7801\u56FE\u7247\u5DF2\u52A0\u8F7D\u5B8C\u6210\u3002" : "\u9A8C\u8BC1\u7801\u56FE\u7247\u5DF2\u5C31\u7EEA\u3002");
|
|
3198
|
+
return;
|
|
3199
|
+
}
|
|
3200
|
+
if (hasErrorTextVisible) {
|
|
3201
|
+
logger9.warn("\u9A8C\u8BC1\u7801\u9762\u677F\u51FA\u73B0\u7F51\u7EDC\u5F02\u5E38\u6587\u6848\uFF0C\u5C1D\u8BD5\u7ACB\u5373\u5237\u65B0\u9898\u76EE\u3002");
|
|
3202
|
+
await refreshCaptcha(page, frame, options);
|
|
3203
|
+
refreshDeadline = Date.now() + options.challengeReadyRefreshTimeoutMs;
|
|
3204
|
+
hasSeenLoading = false;
|
|
3205
|
+
continue;
|
|
3206
|
+
}
|
|
3207
|
+
if (!hasVisibleSourceImage && Date.now() >= refreshDeadline) {
|
|
3208
|
+
logger9.warn(`\u9A8C\u8BC1\u7801\u56FE\u7247\u8D85\u8FC7 ${options.challengeReadyRefreshTimeoutMs}ms \u4ECD\u672A\u51FA\u73B0\uFF0C\u5C1D\u8BD5\u5237\u65B0\u9898\u76EE\u3002`);
|
|
3209
|
+
await refreshCaptcha(page, frame, options);
|
|
3210
|
+
refreshDeadline = Date.now() + options.challengeReadyRefreshTimeoutMs;
|
|
3211
|
+
hasSeenLoading = false;
|
|
3212
|
+
continue;
|
|
3213
|
+
}
|
|
3214
|
+
await page.waitForTimeout(options.challengeReadyPollMs);
|
|
3325
3215
|
}
|
|
3326
|
-
|
|
3327
|
-
await page.mouse.up();
|
|
3328
|
-
await page.waitForTimeout(100);
|
|
3216
|
+
throw new Error("Captcha challenge is still loading and did not become ready in time.");
|
|
3329
3217
|
};
|
|
3330
|
-
|
|
3331
|
-
const
|
|
3332
|
-
if (
|
|
3333
|
-
|
|
3334
|
-
return false;
|
|
3218
|
+
async function solveCaptcha(page, options = {}, dependencies = {}) {
|
|
3219
|
+
const { callCaptchaRecognitionApi: callCaptchaRecognitionApi2 } = dependencies;
|
|
3220
|
+
if (typeof callCaptchaRecognitionApi2 !== "function") {
|
|
3221
|
+
throw new Error("[Captcha] \u7F3A\u5C11\u901A\u7528\u8BC6\u522B\u8BF7\u6C42\u51FD\u6570 callCaptchaRecognitionApi\u3002");
|
|
3335
3222
|
}
|
|
3336
|
-
await page.waitForTimeout(options.refreshWaitMs);
|
|
3337
|
-
return true;
|
|
3338
|
-
};
|
|
3339
|
-
async function solveBytedanceCaptcha(page, options = {}) {
|
|
3340
3223
|
const config = {
|
|
3341
3224
|
...DEFAULT_BYTEDANCE_CAPTCHA_OPTIONS,
|
|
3342
3225
|
...options
|
|
@@ -3345,6 +3228,7 @@ async function solveBytedanceCaptcha(page, options = {}) {
|
|
|
3345
3228
|
logger9.warn("\u7F3A\u5C11\u9A8C\u8BC1\u7801 token\uFF0C\u8DF3\u8FC7\u81EA\u52A8\u8BC6\u522B\u3002");
|
|
3346
3229
|
return false;
|
|
3347
3230
|
}
|
|
3231
|
+
logger9.info("\u5F53\u524D\u4F7F\u7528\u672Ctool\u2014\u2014\u6D4B\u8BD5\u7248\u672C");
|
|
3348
3232
|
for (let attempt = 1; attempt <= config.maxRetries; attempt++) {
|
|
3349
3233
|
logger9.info(`\u5F00\u59CB\u7B2C ${attempt}/${config.maxRetries} \u6B21 verifycenter \u9A8C\u8BC1\u7801\u8BC6\u522B\u3002`);
|
|
3350
3234
|
try {
|
|
@@ -3357,10 +3241,12 @@ async function solveBytedanceCaptcha(page, options = {}) {
|
|
|
3357
3241
|
await waitForCaptchaChallengeReady(page, frame, config);
|
|
3358
3242
|
await page.waitForTimeout(config.recognitionDelayMs);
|
|
3359
3243
|
const screenshotBuffer = await iframeLocator.screenshot();
|
|
3360
|
-
const apiResponse = await
|
|
3361
|
-
|
|
3362
|
-
config
|
|
3363
|
-
|
|
3244
|
+
const apiResponse = await callCaptchaRecognitionApi2({
|
|
3245
|
+
apiUrl: config.apiUrl,
|
|
3246
|
+
type: config.apiType,
|
|
3247
|
+
image: screenshotBuffer.toString("base64"),
|
|
3248
|
+
token: config.token
|
|
3249
|
+
});
|
|
3364
3250
|
const serialNumbers = extractCaptchaSerialNumbers(apiResponse);
|
|
3365
3251
|
if (apiResponse?.code !== config.recognitionSuccessCode || serialNumbers.length === 0) {
|
|
3366
3252
|
logger9.warn(
|
|
@@ -3416,15 +3302,178 @@ async function solveBytedanceCaptcha(page, options = {}) {
|
|
|
3416
3302
|
logger9.error(`\u91CD\u8BD5 ${config.maxRetries} \u6B21\u540E\uFF0C\u9A8C\u8BC1\u7801\u4ECD\u672A\u8BC6\u522B\u6210\u529F\u3002`);
|
|
3417
3303
|
return false;
|
|
3418
3304
|
}
|
|
3305
|
+
var sloveCaptcha = solveCaptcha;
|
|
3306
|
+
|
|
3307
|
+
// src/chaptcha.js
|
|
3308
|
+
var logger10 = createInternalLogger("Captcha");
|
|
3309
|
+
var DEFAULT_CAPTCHA_RECOGNITION_OPTIONS = Object.freeze({
|
|
3310
|
+
token: "eKJvBfwfN0YRav0-VD_44E2VBSfm7l0YtddUQ7cFySI",
|
|
3311
|
+
apiUrl: "https://api.jfbym.com/api/YmServer/customApi"
|
|
3312
|
+
});
|
|
3313
|
+
var CAPTCHA_STRATEGIES = Object.freeze({
|
|
3314
|
+
bytedance: {
|
|
3315
|
+
sloveCaptcha
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3318
|
+
var mergeDefinedOptions = (...sources) => {
|
|
3319
|
+
const merged = {};
|
|
3320
|
+
for (const source of sources) {
|
|
3321
|
+
for (const [key, value] of Object.entries(source || {})) {
|
|
3322
|
+
if (value !== void 0) {
|
|
3323
|
+
merged[key] = value;
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3326
|
+
}
|
|
3327
|
+
return merged;
|
|
3328
|
+
};
|
|
3329
|
+
function useCaptchaMonitor(page, options) {
|
|
3330
|
+
const { domSelector, urlPattern, onDetected } = options;
|
|
3331
|
+
if (!domSelector && !urlPattern) {
|
|
3332
|
+
throw new Error("[CaptchaMonitor] \u5FC5\u987B\u63D0\u4F9B domSelector \u6216 urlPattern\u3002");
|
|
3333
|
+
}
|
|
3334
|
+
if (!onDetected || typeof onDetected !== "function") {
|
|
3335
|
+
throw new Error("[CaptchaMonitor] onDetected \u5FC5\u987B\u662F\u51FD\u6570\u3002");
|
|
3336
|
+
}
|
|
3337
|
+
let isStopped = false;
|
|
3338
|
+
let isHandling = false;
|
|
3339
|
+
let frameHandler = null;
|
|
3340
|
+
let exposedFunctionName = null;
|
|
3341
|
+
const triggerDetected = async () => {
|
|
3342
|
+
if (isStopped || isHandling) return;
|
|
3343
|
+
isHandling = true;
|
|
3344
|
+
try {
|
|
3345
|
+
await onDetected();
|
|
3346
|
+
} finally {
|
|
3347
|
+
isHandling = false;
|
|
3348
|
+
}
|
|
3349
|
+
};
|
|
3350
|
+
const cleanupFns = [];
|
|
3351
|
+
if (domSelector) {
|
|
3352
|
+
exposedFunctionName = `__c_d_${(0, import_uuid.v4)().replace(/-/g, "_")}`;
|
|
3353
|
+
const cleanerName = `__c_cleaner_${(0, import_uuid.v4)().replace(/-/g, "_")}`;
|
|
3354
|
+
page.exposeFunction(exposedFunctionName, triggerDetected).catch(() => {
|
|
3355
|
+
});
|
|
3356
|
+
page.addInitScript(({ selector, callbackName, cleanerName: cleanupName }) => {
|
|
3357
|
+
(() => {
|
|
3358
|
+
let observer = null;
|
|
3359
|
+
const checkAndReport = () => {
|
|
3360
|
+
const element = document.querySelector(selector);
|
|
3361
|
+
if (!element) {
|
|
3362
|
+
return false;
|
|
3363
|
+
}
|
|
3364
|
+
if (window[callbackName]) {
|
|
3365
|
+
window[callbackName]();
|
|
3366
|
+
}
|
|
3367
|
+
return true;
|
|
3368
|
+
};
|
|
3369
|
+
checkAndReport();
|
|
3370
|
+
observer = new MutationObserver((mutations) => {
|
|
3371
|
+
const shouldCheck = mutations.some((mutation) => mutation.addedNodes.length > 0);
|
|
3372
|
+
if (shouldCheck && observer) {
|
|
3373
|
+
checkAndReport();
|
|
3374
|
+
}
|
|
3375
|
+
});
|
|
3376
|
+
const mountObserver = () => {
|
|
3377
|
+
const target = document.documentElement;
|
|
3378
|
+
if (target && observer) {
|
|
3379
|
+
observer.observe(target, { childList: true, subtree: true });
|
|
3380
|
+
}
|
|
3381
|
+
};
|
|
3382
|
+
if (document.readyState === "loading") {
|
|
3383
|
+
window.addEventListener("DOMContentLoaded", mountObserver);
|
|
3384
|
+
} else {
|
|
3385
|
+
mountObserver();
|
|
3386
|
+
}
|
|
3387
|
+
window[cleanupName] = () => {
|
|
3388
|
+
if (observer) {
|
|
3389
|
+
observer.disconnect();
|
|
3390
|
+
observer = null;
|
|
3391
|
+
}
|
|
3392
|
+
};
|
|
3393
|
+
})();
|
|
3394
|
+
}, { selector: domSelector, callbackName: exposedFunctionName, cleanerName });
|
|
3395
|
+
logger10.success("useCaptchaMonitor", `DOM \u76D1\u63A7\u5DF2\u542F\u7528\uFF1A${domSelector}`);
|
|
3396
|
+
cleanupFns.push(async () => {
|
|
3397
|
+
try {
|
|
3398
|
+
await page.evaluate((name) => {
|
|
3399
|
+
if (window[name]) {
|
|
3400
|
+
window[name]();
|
|
3401
|
+
delete window[name];
|
|
3402
|
+
}
|
|
3403
|
+
}, cleanerName);
|
|
3404
|
+
} catch {
|
|
3405
|
+
}
|
|
3406
|
+
});
|
|
3407
|
+
}
|
|
3408
|
+
if (urlPattern) {
|
|
3409
|
+
frameHandler = async (frame) => {
|
|
3410
|
+
if (frame !== page.mainFrame()) {
|
|
3411
|
+
return;
|
|
3412
|
+
}
|
|
3413
|
+
const currentUrl = page.url();
|
|
3414
|
+
if (currentUrl.includes(urlPattern)) {
|
|
3415
|
+
await triggerDetected();
|
|
3416
|
+
}
|
|
3417
|
+
};
|
|
3418
|
+
page.on("framenavigated", frameHandler);
|
|
3419
|
+
logger10.success("useCaptchaMonitor", `URL \u76D1\u63A7\u5DF2\u542F\u7528\uFF1A${urlPattern}`);
|
|
3420
|
+
cleanupFns.push(async () => {
|
|
3421
|
+
page.off("framenavigated", frameHandler);
|
|
3422
|
+
});
|
|
3423
|
+
}
|
|
3424
|
+
return {
|
|
3425
|
+
stop: async () => {
|
|
3426
|
+
logger10.info("\u6B63\u5728\u505C\u6B62\u9A8C\u8BC1\u7801\u76D1\u63A7...");
|
|
3427
|
+
for (const fn of cleanupFns) {
|
|
3428
|
+
await fn();
|
|
3429
|
+
}
|
|
3430
|
+
isStopped = true;
|
|
3431
|
+
}
|
|
3432
|
+
};
|
|
3433
|
+
}
|
|
3434
|
+
var callCaptchaRecognitionApi = async (requestParams = {}) => {
|
|
3435
|
+
const { apiUrl, ...payload } = mergeDefinedOptions(
|
|
3436
|
+
DEFAULT_CAPTCHA_RECOGNITION_OPTIONS,
|
|
3437
|
+
requestParams
|
|
3438
|
+
);
|
|
3439
|
+
if (!apiUrl) {
|
|
3440
|
+
throw new Error("[Captcha] \u7F3A\u5C11\u9A8C\u8BC1\u7801\u8BC6\u522B\u63A5\u53E3\u5730\u5740 apiUrl\u3002");
|
|
3441
|
+
}
|
|
3442
|
+
const response = await fetch(apiUrl, {
|
|
3443
|
+
method: "POST",
|
|
3444
|
+
headers: {
|
|
3445
|
+
"Content-Type": "application/json"
|
|
3446
|
+
},
|
|
3447
|
+
body: JSON.stringify(payload)
|
|
3448
|
+
});
|
|
3449
|
+
if (!response.ok) {
|
|
3450
|
+
throw new Error(`Captcha API request failed with status ${response.status}`);
|
|
3451
|
+
}
|
|
3452
|
+
return await response.json();
|
|
3453
|
+
};
|
|
3454
|
+
async function solveCaptchaWithStrategy(strategyName, page, options = {}) {
|
|
3455
|
+
const strategy = CAPTCHA_STRATEGIES[strategyName];
|
|
3456
|
+
if (!strategy?.sloveCaptcha) {
|
|
3457
|
+
throw new Error(`[Captcha] \u672A\u627E\u5230\u9A8C\u8BC1\u7801\u7B56\u7565\uFF1A${strategyName}`);
|
|
3458
|
+
}
|
|
3459
|
+
const resolvedOptions = mergeDefinedOptions(
|
|
3460
|
+
DEFAULT_CAPTCHA_RECOGNITION_OPTIONS,
|
|
3461
|
+
options
|
|
3462
|
+
);
|
|
3463
|
+
return strategy.sloveCaptcha(page, resolvedOptions, {
|
|
3464
|
+
callCaptchaRecognitionApi,
|
|
3465
|
+
logger: logger10
|
|
3466
|
+
});
|
|
3467
|
+
}
|
|
3419
3468
|
var Captcha = {
|
|
3420
3469
|
useCaptchaMonitor,
|
|
3421
|
-
|
|
3470
|
+
solveCaptchaWithStrategy
|
|
3422
3471
|
};
|
|
3423
3472
|
|
|
3424
3473
|
// src/mutation.js
|
|
3425
3474
|
var import_node_crypto = require("node:crypto");
|
|
3426
3475
|
var import_uuid2 = require("uuid");
|
|
3427
|
-
var
|
|
3476
|
+
var logger11 = createInternalLogger("Mutation");
|
|
3428
3477
|
var MUTATION_MONITOR_MODE = Object.freeze({
|
|
3429
3478
|
Added: "added",
|
|
3430
3479
|
Changed: "changed",
|
|
@@ -3457,14 +3506,14 @@ var Mutation = {
|
|
|
3457
3506
|
const stableTime = options.stableTime ?? 5 * 1e3;
|
|
3458
3507
|
const timeout = options.timeout ?? 120 * 1e3;
|
|
3459
3508
|
const onMutation = options.onMutation;
|
|
3460
|
-
|
|
3509
|
+
logger11.start("waitForStable", `\u76D1\u63A7 ${selectorList.length} \u4E2A\u9009\u62E9\u5668, \u7A33\u5B9A\u65F6\u95F4=${stableTime}ms`);
|
|
3461
3510
|
if (initialTimeout > 0) {
|
|
3462
3511
|
const selectorQuery = selectorList.join(",");
|
|
3463
3512
|
try {
|
|
3464
3513
|
await page.waitForSelector(selectorQuery, { timeout: initialTimeout });
|
|
3465
|
-
|
|
3514
|
+
logger11.info(`waitForStable \u5DF2\u68C0\u6D4B\u5230\u5143\u7D20: ${selectorQuery}`);
|
|
3466
3515
|
} catch (e) {
|
|
3467
|
-
|
|
3516
|
+
logger11.warning(`waitForStable \u521D\u59CB\u7B49\u5F85\u8D85\u65F6 (${initialTimeout}ms): ${selectorQuery}`);
|
|
3468
3517
|
throw e;
|
|
3469
3518
|
}
|
|
3470
3519
|
}
|
|
@@ -3480,7 +3529,7 @@ var Mutation = {
|
|
|
3480
3529
|
return "__CONTINUE__";
|
|
3481
3530
|
}
|
|
3482
3531
|
});
|
|
3483
|
-
|
|
3532
|
+
logger11.info("waitForStable \u5DF2\u542F\u7528 onMutation \u56DE\u8C03");
|
|
3484
3533
|
} catch (e) {
|
|
3485
3534
|
}
|
|
3486
3535
|
}
|
|
@@ -3595,9 +3644,9 @@ var Mutation = {
|
|
|
3595
3644
|
{ selectorList, stableTime, timeout, callbackName, hasCallback: !!onMutation }
|
|
3596
3645
|
);
|
|
3597
3646
|
if (result.mutationCount === 0 && result.stableTime === 0) {
|
|
3598
|
-
|
|
3647
|
+
logger11.warning("waitForStable \u672A\u627E\u5230\u53EF\u76D1\u63A7\u7684\u5143\u7D20");
|
|
3599
3648
|
}
|
|
3600
|
-
|
|
3649
|
+
logger11.success("waitForStable", `DOM \u7A33\u5B9A, \u603B\u5171 ${result.mutationCount} \u6B21\u53D8\u5316${result.wasPaused ? ", \u66FE\u6682\u505C\u8BA1\u65F6" : ""}`);
|
|
3601
3650
|
return result;
|
|
3602
3651
|
},
|
|
3603
3652
|
/**
|
|
@@ -3769,22 +3818,22 @@ var Mutation = {
|
|
|
3769
3818
|
return "__CONTINUE__";
|
|
3770
3819
|
}
|
|
3771
3820
|
};
|
|
3772
|
-
|
|
3821
|
+
logger11.start(
|
|
3773
3822
|
"waitForStableAcrossRoots",
|
|
3774
3823
|
`\u76D1\u63A7 ${selectorList.length} \u4E2A\u9009\u62E9\u5668(\u8DE8 root), \u7A33\u5B9A\u65F6\u95F4=${waitForStableTime}ms`
|
|
3775
3824
|
);
|
|
3776
3825
|
if (initialTimeout > 0) {
|
|
3777
3826
|
try {
|
|
3778
3827
|
await page.waitForSelector(selectorQuery, { timeout: initialTimeout });
|
|
3779
|
-
|
|
3828
|
+
logger11.info(`waitForStableAcrossRoots \u5DF2\u68C0\u6D4B\u5230\u5143\u7D20: ${selectorQuery}`);
|
|
3780
3829
|
} catch (e) {
|
|
3781
|
-
|
|
3830
|
+
logger11.warning(`waitForStableAcrossRoots \u521D\u59CB\u7B49\u5F85\u8D85\u65F6 (${initialTimeout}ms): ${selectorQuery}`);
|
|
3782
3831
|
throw e;
|
|
3783
3832
|
}
|
|
3784
3833
|
}
|
|
3785
3834
|
let state = await buildState();
|
|
3786
3835
|
if (!state?.hasMatched) {
|
|
3787
|
-
|
|
3836
|
+
logger11.warning("waitForStableAcrossRoots \u672A\u627E\u5230\u53EF\u76D1\u63A7\u7684\u5143\u7D20");
|
|
3788
3837
|
return { mutationCount: 0, stableTime: 0, wasPaused: false };
|
|
3789
3838
|
}
|
|
3790
3839
|
let mutationCount = 0;
|
|
@@ -3821,7 +3870,7 @@ var Mutation = {
|
|
|
3821
3870
|
if (lastState.snapshotKey !== lastSnapshotKey) {
|
|
3822
3871
|
lastSnapshotKey = lastState.snapshotKey;
|
|
3823
3872
|
mutationCount += 1;
|
|
3824
|
-
|
|
3873
|
+
logger11.info(
|
|
3825
3874
|
`waitForStableAcrossRoots \u53D8\u5316#${mutationCount}, len=${lastState.snapshotLength}, path=${lastState.primaryPath || "unknown"}, preview="${truncate(lastState.text, 120)}"`
|
|
3826
3875
|
);
|
|
3827
3876
|
const signal = await invokeMutationCallback({
|
|
@@ -3834,7 +3883,7 @@ var Mutation = {
|
|
|
3834
3883
|
continue;
|
|
3835
3884
|
}
|
|
3836
3885
|
if (!isPaused && stableSince > 0 && Date.now() - stableSince >= waitForStableTime) {
|
|
3837
|
-
|
|
3886
|
+
logger11.success("waitForStableAcrossRoots", `DOM \u7A33\u5B9A, \u603B\u5171 ${mutationCount} \u6B21\u53D8\u5316${wasPaused ? ", \u66FE\u6682\u505C\u8BA1\u65F6" : ""}`);
|
|
3838
3887
|
return {
|
|
3839
3888
|
mutationCount,
|
|
3840
3889
|
stableTime: waitForStableTime,
|
|
@@ -3861,7 +3910,7 @@ var Mutation = {
|
|
|
3861
3910
|
const onMutation = options.onMutation;
|
|
3862
3911
|
const rawMode = String(options.mode || MUTATION_MONITOR_MODE.Added).toLowerCase();
|
|
3863
3912
|
const mode = [MUTATION_MONITOR_MODE.Added, MUTATION_MONITOR_MODE.Changed, MUTATION_MONITOR_MODE.All].includes(rawMode) ? rawMode : MUTATION_MONITOR_MODE.Added;
|
|
3864
|
-
|
|
3913
|
+
logger11.start("useMonitor", `\u76D1\u63A7 ${selectorList.length} \u4E2A\u9009\u62E9\u5668, mode=${mode}`);
|
|
3865
3914
|
const monitorKey = generateKey("pk_mon");
|
|
3866
3915
|
const callbackName = generateKey("pk_mon_cb");
|
|
3867
3916
|
const cleanerName = generateKey("pk_mon_clean");
|
|
@@ -4004,7 +4053,7 @@ var Mutation = {
|
|
|
4004
4053
|
return total;
|
|
4005
4054
|
};
|
|
4006
4055
|
}, { selectorList, monitorKey, callbackName, cleanerName, hasCallback: !!onMutation, mode });
|
|
4007
|
-
|
|
4056
|
+
logger11.success("useMonitor", "\u76D1\u63A7\u5668\u5DF2\u542F\u52A8");
|
|
4008
4057
|
return {
|
|
4009
4058
|
stop: async () => {
|
|
4010
4059
|
let totalMutations = 0;
|
|
@@ -4017,7 +4066,7 @@ var Mutation = {
|
|
|
4017
4066
|
}, cleanerName);
|
|
4018
4067
|
} catch (e) {
|
|
4019
4068
|
}
|
|
4020
|
-
|
|
4069
|
+
logger11.success("useMonitor.stop", `\u76D1\u63A7\u5DF2\u505C\u6B62, \u5171 ${totalMutations} \u6B21\u53D8\u5316`);
|
|
4021
4070
|
return { totalMutations };
|
|
4022
4071
|
}
|
|
4023
4072
|
};
|
|
@@ -4886,7 +4935,7 @@ var createTemplateLogger = (baseLogger = createBaseLogger()) => {
|
|
|
4886
4935
|
};
|
|
4887
4936
|
var getDefaultBaseLogger = () => createBaseLogger("");
|
|
4888
4937
|
var Logger = {
|
|
4889
|
-
setLogger: (
|
|
4938
|
+
setLogger: (logger14) => setDefaultLogger(logger14),
|
|
4890
4939
|
info: (message) => getDefaultBaseLogger().info(message),
|
|
4891
4940
|
success: (message) => getDefaultBaseLogger().success(message),
|
|
4892
4941
|
warning: (message) => getDefaultBaseLogger().warning(message),
|
|
@@ -4894,8 +4943,8 @@ var Logger = {
|
|
|
4894
4943
|
error: (message) => getDefaultBaseLogger().error(message),
|
|
4895
4944
|
debug: (message) => getDefaultBaseLogger().debug(message),
|
|
4896
4945
|
start: (message) => getDefaultBaseLogger().start(message),
|
|
4897
|
-
useTemplate: (
|
|
4898
|
-
if (
|
|
4946
|
+
useTemplate: (logger14) => {
|
|
4947
|
+
if (logger14) return createTemplateLogger(createBaseLogger("", logger14));
|
|
4899
4948
|
return createTemplateLogger();
|
|
4900
4949
|
}
|
|
4901
4950
|
};
|
|
@@ -4960,7 +5009,7 @@ var LOCATION_NETWORK_SUFFIX_PATTERNS = [
|
|
|
4960
5009
|
];
|
|
4961
5010
|
var cachedStripLogoSrcPromise = null;
|
|
4962
5011
|
var cachedEnrichmentByContext = /* @__PURE__ */ new WeakMap();
|
|
4963
|
-
var
|
|
5012
|
+
var logger12 = createInternalLogger("Watermarkify");
|
|
4964
5013
|
var normalizeText = (value) => String(value || "").trim();
|
|
4965
5014
|
var toInline = (value, maxLen = 200) => {
|
|
4966
5015
|
const text = normalizeText(value);
|
|
@@ -5202,9 +5251,9 @@ var resolveWithCustomResolver = async (page, baseMeta, options = {}) => {
|
|
|
5202
5251
|
location: toInline(resolved.location, 80)
|
|
5203
5252
|
};
|
|
5204
5253
|
if (enrichment.ip || enrichment.location) {
|
|
5205
|
-
|
|
5254
|
+
logger12.info(`\u81EA\u5B9A\u4E49 resolver \u547D\u4E2D: ip=${enrichment.ip || "-"}, loc=${enrichment.location || "-"}`);
|
|
5206
5255
|
} else {
|
|
5207
|
-
|
|
5256
|
+
logger12.warning("\u81EA\u5B9A\u4E49 resolver \u5DF2\u6267\u884C\uFF0C\u4F46\u672A\u8FD4\u56DE IP/Loc");
|
|
5208
5257
|
}
|
|
5209
5258
|
return enrichment;
|
|
5210
5259
|
} finally {
|
|
@@ -5388,12 +5437,12 @@ var buildWatermarkifyRenderHtml = ({ imageSrc, overlaySvg, width, height }) => {
|
|
|
5388
5437
|
};
|
|
5389
5438
|
var composeScreenshotBufferWithBrowser = async (page, buffer, overlaySvg, imageInfo = {}) => {
|
|
5390
5439
|
if (!page || typeof page.context !== "function") {
|
|
5391
|
-
|
|
5440
|
+
logger12.warning("watermarkify \u6D4F\u89C8\u5668\u5408\u6210\u8DF3\u8FC7: \u7F3A\u5C11\u53EF\u7528 page");
|
|
5392
5441
|
return buffer;
|
|
5393
5442
|
}
|
|
5394
5443
|
const renderScope = await openProbePage(page);
|
|
5395
5444
|
if (!renderScope?.page) {
|
|
5396
|
-
|
|
5445
|
+
logger12.warning("watermarkify \u6D4F\u89C8\u5668\u5408\u6210\u8DF3\u8FC7: \u65E0\u6CD5\u521B\u5EFA render page");
|
|
5397
5446
|
return buffer;
|
|
5398
5447
|
}
|
|
5399
5448
|
try {
|
|
@@ -5436,13 +5485,13 @@ var composeScreenshotBufferWithBrowser = async (page, buffer, overlaySvg, imageI
|
|
|
5436
5485
|
fullPage: true,
|
|
5437
5486
|
animations: "disabled"
|
|
5438
5487
|
}).catch((error) => {
|
|
5439
|
-
|
|
5488
|
+
logger12.warning(`watermarkify \u6D4F\u89C8\u5668\u5408\u6210\u5931\u8D25: ${error instanceof Error ? error.message : String(error)}`);
|
|
5440
5489
|
return null;
|
|
5441
5490
|
});
|
|
5442
5491
|
if (Buffer.isBuffer(composed) && composed.length > 0) {
|
|
5443
5492
|
return composed;
|
|
5444
5493
|
}
|
|
5445
|
-
|
|
5494
|
+
logger12.warning("watermarkify \u6D4F\u89C8\u5668\u5408\u6210\u5931\u8D25: \u672A\u5F97\u5230\u6709\u6548\u622A\u56FE\u7ED3\u679C");
|
|
5446
5495
|
return buffer;
|
|
5447
5496
|
} finally {
|
|
5448
5497
|
await renderScope.close().catch(() => {
|
|
@@ -5455,7 +5504,7 @@ var resolveWithIpLookup = async (page, options = {}) => {
|
|
|
5455
5504
|
}
|
|
5456
5505
|
const probeScope = await openProbePage(page);
|
|
5457
5506
|
if (!probeScope?.page) {
|
|
5458
|
-
|
|
5507
|
+
logger12.warning("ipLookup \u8DF3\u8FC7: \u65E0\u6CD5\u521B\u5EFA probe page");
|
|
5459
5508
|
return null;
|
|
5460
5509
|
}
|
|
5461
5510
|
const timeoutMs = Math.max(
|
|
@@ -5464,12 +5513,12 @@ var resolveWithIpLookup = async (page, options = {}) => {
|
|
|
5464
5513
|
);
|
|
5465
5514
|
try {
|
|
5466
5515
|
const probePage = probeScope.page;
|
|
5467
|
-
|
|
5516
|
+
logger12.info(`ipLookup \u5C1D\u8BD5: url=${DEFAULT_IP_LOOKUP_URL}, timeoutMs=${timeoutMs}`);
|
|
5468
5517
|
const response = await probePage.goto(DEFAULT_IP_LOOKUP_URL, {
|
|
5469
5518
|
waitUntil: "commit",
|
|
5470
5519
|
timeout: timeoutMs
|
|
5471
5520
|
}).catch((error) => {
|
|
5472
|
-
|
|
5521
|
+
logger12.warning(`ipLookup \u8BF7\u6C42\u5931\u8D25: url=${DEFAULT_IP_LOOKUP_URL}, error=${error instanceof Error ? error.message : String(error)}`);
|
|
5473
5522
|
return null;
|
|
5474
5523
|
});
|
|
5475
5524
|
const status = response && typeof response.status === "function" ? response.status() : 0;
|
|
@@ -5491,13 +5540,13 @@ var resolveWithIpLookup = async (page, options = {}) => {
|
|
|
5491
5540
|
}
|
|
5492
5541
|
const parsed = parseIpIpJsonResponse(rawText);
|
|
5493
5542
|
if (parsed?.ip || parsed?.location) {
|
|
5494
|
-
|
|
5543
|
+
logger12.info(`ipLookup \u6210\u529F: url=${DEFAULT_IP_LOOKUP_URL}, status=${status || "-"}, contentType=${contentType || "-"}, ip=${parsed.ip || "-"}, loc=${parsed.location || "-"}`);
|
|
5495
5544
|
return parsed;
|
|
5496
5545
|
}
|
|
5497
|
-
|
|
5546
|
+
logger12.warning(`ipLookup \u672A\u89E3\u6790\u51FA IP/Loc: url=${DEFAULT_IP_LOOKUP_URL}, status=${status || "-"}, contentType=${contentType || "-"}, preview=${shortenTail(rawText, 120) || "[empty]"}`);
|
|
5498
5547
|
return null;
|
|
5499
5548
|
} catch (error) {
|
|
5500
|
-
|
|
5549
|
+
logger12.warning(`ipLookup \u6267\u884C\u5F02\u5E38\uFF0C\u672A\u83B7\u5F97 IP/Loc: ${error instanceof Error ? error.message : String(error)}`);
|
|
5501
5550
|
return null;
|
|
5502
5551
|
} finally {
|
|
5503
5552
|
await probeScope.close().catch(() => {
|
|
@@ -5511,10 +5560,10 @@ var resolveEnrichment = async (page, baseMeta, options) => {
|
|
|
5511
5560
|
ip: toInline(options.ip, 80),
|
|
5512
5561
|
location: toInline(options.location, 80)
|
|
5513
5562
|
};
|
|
5514
|
-
|
|
5563
|
+
logger12.info(`enrichment \u5F00\u59CB: host=${baseMeta.hostname || "-"}, hasPresetIp=${Boolean(merged.ip)}, hasPresetLoc=${Boolean(merged.location)}, ipLookup=${options.ipLookup !== false}`);
|
|
5515
5564
|
if (!merged.ip || !merged.location) {
|
|
5516
5565
|
if (cached?.ip || cached?.location) {
|
|
5517
|
-
|
|
5566
|
+
logger12.info(`enrichment \u547D\u4E2D\u4E0A\u4E0B\u6587\u7F13\u5B58: ip=${cached.ip || "-"}, loc=${cached.location || "-"}`);
|
|
5518
5567
|
}
|
|
5519
5568
|
fillEnrichment(merged, cached);
|
|
5520
5569
|
}
|
|
@@ -5538,15 +5587,15 @@ var resolveEnrichment = async (page, baseMeta, options) => {
|
|
|
5538
5587
|
"x-geo-country"
|
|
5539
5588
|
]), 80);
|
|
5540
5589
|
if (!merged.location || isWeakLocationValue(merged.location) && headerLocation) {
|
|
5541
|
-
|
|
5590
|
+
logger12.info(`enrichment \u4F7F\u7528\u54CD\u5E94\u5934\u8865\u5145 Loc: ${headerLocation || "-"}`);
|
|
5542
5591
|
merged.location = headerLocation || merged.location;
|
|
5543
5592
|
}
|
|
5544
5593
|
}
|
|
5545
5594
|
writeCachedEnrichment(page, merged);
|
|
5546
5595
|
if (merged.ip || merged.location) {
|
|
5547
|
-
|
|
5596
|
+
logger12.info(`enrichment \u5B8C\u6210: ip=${merged.ip || "-"}, loc=${merged.location || "-"}`);
|
|
5548
5597
|
} else {
|
|
5549
|
-
|
|
5598
|
+
logger12.warning("enrichment \u5B8C\u6210: \u672A\u83B7\u5F97 IP/Loc");
|
|
5550
5599
|
}
|
|
5551
5600
|
return merged;
|
|
5552
5601
|
};
|
|
@@ -6214,7 +6263,7 @@ var watermarkifyScreenshotBuffer = async (buffer, meta, page = null) => {
|
|
|
6214
6263
|
}
|
|
6215
6264
|
const imageInfo = readImageInfo(buffer);
|
|
6216
6265
|
if (!imageInfo.width || !imageInfo.height || !imageInfo.mimeType) {
|
|
6217
|
-
|
|
6266
|
+
logger12.warning("watermarkify \u8DF3\u8FC7: \u65E0\u6CD5\u89E3\u6790\u622A\u56FE\u5C3A\u5BF8\u6216\u683C\u5F0F");
|
|
6218
6267
|
return buffer;
|
|
6219
6268
|
}
|
|
6220
6269
|
const overlaySvg = buildWatermarkifySvg(meta, imageInfo.width, imageInfo.height);
|
|
@@ -6225,7 +6274,7 @@ var watermarkifyScreenshotBuffer = async (buffer, meta, page = null) => {
|
|
|
6225
6274
|
};
|
|
6226
6275
|
|
|
6227
6276
|
// src/share.js
|
|
6228
|
-
var
|
|
6277
|
+
var logger13 = createInternalLogger("Share");
|
|
6229
6278
|
var DEFAULT_TIMEOUT_MS2 = 50 * 1e3;
|
|
6230
6279
|
var DEFAULT_PAYLOAD_SNAPSHOT_MAX_LEN = 500;
|
|
6231
6280
|
var DEFAULT_POLL_INTERVAL_MS = 120;
|
|
@@ -6362,7 +6411,7 @@ var createDomShareMonitor = async (page, options = {}) => {
|
|
|
6362
6411
|
const onMatch = typeof options.onMatch === "function" ? options.onMatch : null;
|
|
6363
6412
|
const onTelemetry = typeof options.onTelemetry === "function" ? options.onTelemetry : null;
|
|
6364
6413
|
let matched = false;
|
|
6365
|
-
|
|
6414
|
+
logger13.info(`DOM \u76D1\u542C\u51C6\u5907\u6302\u8F7D: selectors=${toJsonInline(selectors, 120)}, mode=${mode}`);
|
|
6366
6415
|
const monitor = await Mutation.useMonitor(page, selectors, {
|
|
6367
6416
|
mode,
|
|
6368
6417
|
onMutation: (context = {}) => {
|
|
@@ -6380,12 +6429,12 @@ ${text}`;
|
|
|
6380
6429
|
});
|
|
6381
6430
|
}
|
|
6382
6431
|
if (mutationCount <= 5 || mutationCount % 50 === 0) {
|
|
6383
|
-
|
|
6432
|
+
logger13.info(`DOM \u53D8\u5316\u5DF2\u6355\u83B7: mutationCount=${mutationCount}, mutationNodes=${mutationNodes.length}`);
|
|
6384
6433
|
}
|
|
6385
6434
|
const [candidate] = Utils.parseLinks(rawDom, { prefix }) || [];
|
|
6386
6435
|
if (!candidate) return;
|
|
6387
6436
|
matched = true;
|
|
6388
|
-
|
|
6437
|
+
logger13.success("captureLink.domHit", `DOM \u547D\u4E2D\u5206\u4EAB\u94FE\u63A5: mutationCount=${mutationCount}, link=${candidate}`);
|
|
6389
6438
|
if (onMatch) {
|
|
6390
6439
|
onMatch({
|
|
6391
6440
|
link: candidate,
|
|
@@ -6401,7 +6450,7 @@ ${text}`;
|
|
|
6401
6450
|
return {
|
|
6402
6451
|
stop: async () => {
|
|
6403
6452
|
const result = await monitor.stop();
|
|
6404
|
-
|
|
6453
|
+
logger13.info(`DOM \u76D1\u542C\u5DF2\u505C\u6B62: totalMutations=${result?.totalMutations || 0}`);
|
|
6405
6454
|
return result;
|
|
6406
6455
|
}
|
|
6407
6456
|
};
|
|
@@ -6441,8 +6490,8 @@ var Share = {
|
|
|
6441
6490
|
if (share.mode === "response" && apiMatchers.length === 0) {
|
|
6442
6491
|
throw new Error("Share.captureLink requires share.xurl[0] api matcher when mode=response");
|
|
6443
6492
|
}
|
|
6444
|
-
|
|
6445
|
-
|
|
6493
|
+
logger13.start("captureLink", `mode=${share.mode}, timeoutMs=${timeoutMs}, prefix=${share.prefix}`);
|
|
6494
|
+
logger13.info(`captureLink \u914D\u7F6E: xurl=${toJsonInline(share.xurl)}, domMode=${domMode}, domSelectors=${toJsonInline(domSelectors, 120)}`);
|
|
6446
6495
|
const stats = {
|
|
6447
6496
|
actionTimedOut: false,
|
|
6448
6497
|
domMutationCount: 0,
|
|
@@ -6467,7 +6516,7 @@ var Share = {
|
|
|
6467
6516
|
link: validated,
|
|
6468
6517
|
payloadText: String(payloadText || "")
|
|
6469
6518
|
};
|
|
6470
|
-
|
|
6519
|
+
logger13.info(`\u5019\u9009\u94FE\u63A5\u5DF2\u786E\u8BA4: source=${source}, link=${validated}`);
|
|
6471
6520
|
return true;
|
|
6472
6521
|
};
|
|
6473
6522
|
const resolveResponseCandidate = (responseText) => {
|
|
@@ -6502,7 +6551,7 @@ var Share = {
|
|
|
6502
6551
|
try {
|
|
6503
6552
|
await monitor.stop();
|
|
6504
6553
|
} catch (error) {
|
|
6505
|
-
|
|
6554
|
+
logger13.warning(`\u505C\u6B62 DOM \u76D1\u542C\u5931\u8D25: ${error instanceof Error ? error.message : String(error)}`);
|
|
6506
6555
|
}
|
|
6507
6556
|
};
|
|
6508
6557
|
const onResponse = async (response) => {
|
|
@@ -6515,29 +6564,29 @@ var Share = {
|
|
|
6515
6564
|
stats.responseSampleUrls.push(url);
|
|
6516
6565
|
}
|
|
6517
6566
|
if (stats.responseObserved <= 5) {
|
|
6518
|
-
|
|
6567
|
+
logger13.info(`\u63A5\u53E3\u54CD\u5E94\u91C7\u6837(${stats.responseObserved}): ${url}`);
|
|
6519
6568
|
}
|
|
6520
6569
|
if (!apiMatchers.some((matcher) => url.includes(matcher))) return;
|
|
6521
6570
|
stats.responseMatched += 1;
|
|
6522
6571
|
stats.lastMatchedUrl = url;
|
|
6523
|
-
|
|
6572
|
+
logger13.info(`\u63A5\u53E3\u547D\u4E2D\u5339\u914D(${stats.responseMatched}): ${url}`);
|
|
6524
6573
|
const text = await response.text();
|
|
6525
6574
|
const hit = resolveResponseCandidate(text);
|
|
6526
6575
|
if (!hit?.link) {
|
|
6527
6576
|
if (stats.responseMatched <= 3) {
|
|
6528
|
-
|
|
6577
|
+
logger13.info(`\u63A5\u53E3\u89E3\u6790\u5B8C\u6210\u4F46\u672A\u63D0\u53D6\u5230\u5206\u4EAB\u94FE\u63A5: payloadSize=${text.length}`);
|
|
6529
6578
|
}
|
|
6530
6579
|
return;
|
|
6531
6580
|
}
|
|
6532
6581
|
stats.responseResolved += 1;
|
|
6533
|
-
|
|
6582
|
+
logger13.success("captureLink.responseHit", `\u63A5\u53E3\u547D\u4E2D\u5206\u4EAB\u94FE\u63A5: url=${url}, link=${hit.link}`);
|
|
6534
6583
|
setCandidate("response", hit.link, hit.payloadText);
|
|
6535
6584
|
} catch (error) {
|
|
6536
|
-
|
|
6585
|
+
logger13.warning(`\u63A5\u53E3\u54CD\u5E94\u5904\u7406\u5F02\u5E38: ${error instanceof Error ? error.message : String(error)}`);
|
|
6537
6586
|
}
|
|
6538
6587
|
};
|
|
6539
6588
|
if (share.mode === "dom") {
|
|
6540
|
-
|
|
6589
|
+
logger13.info("\u5F53\u524D\u4E3A DOM \u6A21\u5F0F\uFF0C\u4EC5\u542F\u7528 DOM \u76D1\u542C");
|
|
6541
6590
|
domMonitor = await createDomShareMonitor(page, {
|
|
6542
6591
|
prefix: share.prefix,
|
|
6543
6592
|
selectors: domSelectors,
|
|
@@ -6552,14 +6601,14 @@ var Share = {
|
|
|
6552
6601
|
});
|
|
6553
6602
|
}
|
|
6554
6603
|
if (share.mode === "response") {
|
|
6555
|
-
|
|
6604
|
+
logger13.info(`\u5F53\u524D\u4E3A\u63A5\u53E3\u6A21\u5F0F\uFF0C\u6302\u8F7D response \u76D1\u542C: apiMatchers=${toJsonInline(apiMatchers, 160)}`);
|
|
6556
6605
|
page.on("response", onResponse);
|
|
6557
6606
|
}
|
|
6558
6607
|
const deadline = Date.now() + timeoutMs;
|
|
6559
6608
|
const getRemainingMs = () => Math.max(0, deadline - Date.now());
|
|
6560
6609
|
try {
|
|
6561
6610
|
const actionTimeout = getRemainingMs();
|
|
6562
|
-
|
|
6611
|
+
logger13.start("captureLink.performActions", `\u6267\u884C\u52A8\u4F5C\u9884\u7B97=${actionTimeout}ms`);
|
|
6563
6612
|
if (actionTimeout > 0) {
|
|
6564
6613
|
let timer = null;
|
|
6565
6614
|
let actionError = null;
|
|
@@ -6573,21 +6622,21 @@ var Share = {
|
|
|
6573
6622
|
const actionResult = await Promise.race([actionPromise, timeoutPromise]);
|
|
6574
6623
|
if (timer) clearTimeout(timer);
|
|
6575
6624
|
if (actionResult === "__ACTION_ERROR__") {
|
|
6576
|
-
|
|
6625
|
+
logger13.fail("captureLink.performActions", actionError);
|
|
6577
6626
|
throw actionError;
|
|
6578
6627
|
}
|
|
6579
6628
|
if (actionResult === "__ACTION_TIMEOUT__") {
|
|
6580
6629
|
stats.actionTimedOut = true;
|
|
6581
|
-
|
|
6630
|
+
logger13.warning(`performActions \u5DF2\u8D85\u65F6 (${actionTimeout}ms)\uFF0C\u52A8\u4F5C\u53EF\u80FD\u4ECD\u5728\u5F02\u6B65\u6267\u884C`);
|
|
6582
6631
|
} else {
|
|
6583
|
-
|
|
6632
|
+
logger13.success("captureLink.performActions", "\u6267\u884C\u52A8\u4F5C\u5B8C\u6210");
|
|
6584
6633
|
}
|
|
6585
6634
|
}
|
|
6586
6635
|
let nextProgressLogTs = Date.now() + 3e3;
|
|
6587
6636
|
while (true) {
|
|
6588
6637
|
const selected = share.mode === "dom" ? candidates.dom : candidates.response;
|
|
6589
6638
|
if (selected?.link) {
|
|
6590
|
-
|
|
6639
|
+
logger13.success("captureLink", `\u6355\u83B7\u6210\u529F: source=${share.mode}, link=${selected.link}`);
|
|
6591
6640
|
return {
|
|
6592
6641
|
link: selected.link,
|
|
6593
6642
|
payloadText: selected.payloadText,
|
|
@@ -6599,7 +6648,7 @@ var Share = {
|
|
|
6599
6648
|
if (remaining <= 0) break;
|
|
6600
6649
|
const now = Date.now();
|
|
6601
6650
|
if (now >= nextProgressLogTs) {
|
|
6602
|
-
|
|
6651
|
+
logger13.info(
|
|
6603
6652
|
`captureLink \u7B49\u5F85\u4E2D: remaining=${remaining}ms, domMutationCount=${stats.domMutationCount}, responseMatched=${stats.responseMatched}`
|
|
6604
6653
|
);
|
|
6605
6654
|
nextProgressLogTs = now + 5e3;
|
|
@@ -6607,11 +6656,11 @@ var Share = {
|
|
|
6607
6656
|
await (0, import_delay2.default)(Math.max(0, Math.min(DEFAULT_POLL_INTERVAL_MS, remaining)));
|
|
6608
6657
|
}
|
|
6609
6658
|
if (share.mode === "response" && stats.responseMatched === 0) {
|
|
6610
|
-
|
|
6659
|
+
logger13.warning(
|
|
6611
6660
|
`\u63A5\u53E3\u76D1\u542C\u672A\u547D\u4E2D: apiMatchers=${toJsonInline(apiMatchers, 220)}, \u54CD\u5E94\u6837\u672CURLs=${toJsonInline(stats.responseSampleUrls, 420)}`
|
|
6612
6661
|
);
|
|
6613
6662
|
}
|
|
6614
|
-
|
|
6663
|
+
logger13.warning(
|
|
6615
6664
|
`captureLink \u8D85\u65F6\u672A\u62FF\u5230\u94FE\u63A5: mode=${share.mode}, actionTimedOut=${stats.actionTimedOut}, domMutationCount=${stats.domMutationCount}, responseObserved=${stats.responseObserved}, responseMatched=${stats.responseMatched}, lastMatchedUrl=${stats.lastMatchedUrl || "none"}`
|
|
6616
6665
|
);
|
|
6617
6666
|
return {
|
|
@@ -6623,7 +6672,7 @@ var Share = {
|
|
|
6623
6672
|
} finally {
|
|
6624
6673
|
if (share.mode === "response") {
|
|
6625
6674
|
page.off("response", onResponse);
|
|
6626
|
-
|
|
6675
|
+
logger13.info("response \u76D1\u542C\u5DF2\u5378\u8F7D");
|
|
6627
6676
|
}
|
|
6628
6677
|
await stopDomMonitor();
|
|
6629
6678
|
}
|