@skrillex1224/playwright-toolkit 2.1.250 → 2.1.251

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/browser.js CHANGED
@@ -3502,7 +3502,11 @@ var RuntimeEnv = {
3502
3502
  // 指纹、时区、UA、viewport 的回放发生在 launch.js 启动阶段,不在这里做。
3503
3503
  async applyToPage(page, source = {}, options = {}) {
3504
3504
  if (!page) return;
3505
- const state = normalizeRuntimeState(source, (options == null ? void 0 : options.actor) || "");
3505
+ let state = normalizeRuntimeState(source, (options == null ? void 0 : options.actor) || "");
3506
+ if (typeof (options == null ? void 0 : options.preapply) === "function") {
3507
+ state = await options.preapply(state) || state;
3508
+ rememberRuntimeState(state);
3509
+ }
3506
3510
  Object.defineProperty(page, PageRuntimeStateKey, {
3507
3511
  configurable: true,
3508
3512
  enumerable: false,