@skrillex1224/playwright-toolkit 3.0.31 → 3.0.33

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 CHANGED
@@ -2424,6 +2424,7 @@ async function createApifyKit() {
2424
2424
  }
2425
2425
  const { Actor: Actor2 } = apify;
2426
2426
  const actorInput = await Actor2.getInput() || {};
2427
+ const isDebugMode = Boolean(actorInput.debugMode || actorInput.debug_mode);
2427
2428
  let lastPage = null;
2428
2429
  const getRuntimeContext = () => resolveRuntimeContext(actorInput);
2429
2430
  return {
@@ -2500,6 +2501,14 @@ async function createApifyKit() {
2500
2501
  const finalError = lastResult.error;
2501
2502
  if (failActor) {
2502
2503
  let base64 = "\u622A\u56FE\u5931\u8D25";
2504
+ let html;
2505
+ if (isDebugMode && page) {
2506
+ try {
2507
+ html = await page.content();
2508
+ } catch (htmlErr) {
2509
+ logger3.warn(`HTML \u91C7\u96C6\u5931\u8D25: ${htmlErr.message}`);
2510
+ }
2511
+ }
2503
2512
  try {
2504
2513
  if (page) {
2505
2514
  const buffer = await capturePageScreenshot(page, {
@@ -2517,7 +2526,8 @@ async function createApifyKit() {
2517
2526
  {
2518
2527
  step,
2519
2528
  base64,
2520
- retryAttempts: retryTimes
2529
+ retryAttempts: retryTimes,
2530
+ ...html ? { html } : {}
2521
2531
  },
2522
2532
  {
2523
2533
  page,
@@ -2754,8 +2764,7 @@ var methodDescriptor = (namespace, name, resolveTarget) => ({
2754
2764
  });
2755
2765
  var withModeReflect = (namespace, strategies = {}) => {
2756
2766
  const normalizedStrategies = normalizeStrategies2(strategies);
2757
- const baseStrategy = normalizedStrategies.default ?? Object.values(normalizedStrategies).find(Boolean);
2758
- const names = collectFunctionNames([baseStrategy]);
2767
+ const names = collectFunctionNames(Object.values(normalizedStrategies));
2759
2768
  const descriptors = {};
2760
2769
  for (const name of names) {
2761
2770
  descriptors[name] = methodDescriptor(namespace, name, () => resolveModeStrategy(normalizedStrategies));