@skrillex1224/playwright-toolkit 2.1.209 → 2.1.211

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/README.md CHANGED
@@ -222,7 +222,6 @@ const image2 = await Share.captureScreen(page, { restore: 'width-only' });
222
222
  const image3 = await Share.captureScreen(page, {
223
223
  watermarkify: {
224
224
  query: '你好',
225
- taskId: 'doubao20-20260417-130758-16',
226
225
  timezoneOffsetHours: 8,
227
226
  // 默认会在同一浏览器上下文里访问 http://myip.ipip.net 补充 IP / Loc,超时默认 10000ms
228
227
  },
@@ -232,7 +231,6 @@ const image3 = await Share.captureScreen(page, {
232
231
  const image4 = await Share.captureScreen(page, {
233
232
  watermarkify: {
234
233
  query: '你好',
235
- taskId: 'doubao20-20260417-130758-16',
236
234
  ipLookup: false,
237
235
  resolverTimeoutMs: 180,
238
236
  resolver: async ({ signal }) => {
@@ -244,6 +242,9 @@ const image4 = await Share.captureScreen(page, {
244
242
  },
245
243
  });
246
244
 
245
+ // Prompt 字段默认取值链路:query -> prompt -> 页面 title
246
+ // 所以 runtime input 只传 query 就够了,底部 Prompt 展示的就是实际问 AI 的 query
247
+
247
248
  // 如需原始截图,可显式关闭 watermarkify
248
249
  const image5 = await Share.captureScreen(page, {
249
250
  watermarkify: false,
package/dist/browser.js CHANGED
@@ -2874,6 +2874,9 @@ var ByPass = {
2874
2874
  resolveRouteByProxy
2875
2875
  };
2876
2876
 
2877
+ // src/internals/constants.js
2878
+ var PageRuntimeStateKey = "__playwright_toolkit_runtime_state__";
2879
+
2877
2880
  // src/runtime-env.js
2878
2881
  var BROWSER_PROFILE_SCHEMA_VERSION = 1;
2879
2882
  var rememberedRuntimeState = null;
@@ -3383,6 +3386,7 @@ var RuntimeEnv = {
3383
3386
  parseInput(input = {}, actor = "") {
3384
3387
  const runtime = tryParseJSON(input == null ? void 0 : input.runtime) || {};
3385
3388
  const resolvedActor = String(actor || (input == null ? void 0 : input.actor) || "").trim();
3389
+ const query = String((input == null ? void 0 : input.query) || "").trim();
3386
3390
  const cookies = normalizeCookies(runtime == null ? void 0 : runtime.cookies);
3387
3391
  const cookieMap = buildCookieMap(cookies);
3388
3392
  const localStorage = normalizeLocalStorage(runtime == null ? void 0 : runtime.local_storage);
@@ -3406,6 +3410,7 @@ var RuntimeEnv = {
3406
3410
  actor: resolvedActor,
3407
3411
  runtime: normalizedRuntime,
3408
3412
  envId,
3413
+ query,
3409
3414
  auth,
3410
3415
  cookies,
3411
3416
  cookieMap,
@@ -3474,6 +3479,12 @@ var RuntimeEnv = {
3474
3479
  async applyToPage(page, source = {}, options = {}) {
3475
3480
  if (!page) return;
3476
3481
  const state = normalizeRuntimeState(source, (options == null ? void 0 : options.actor) || "");
3482
+ Object.defineProperty(page, PageRuntimeStateKey, {
3483
+ configurable: true,
3484
+ enumerable: false,
3485
+ writable: true,
3486
+ value: state
3487
+ });
3477
3488
  const localStorage = state.localStorage || {};
3478
3489
  const sessionStorage = state.sessionStorage || {};
3479
3490
  const cookies = (state.cookies || []).map((cookie) => {