zulip/patches/puppeteer-core.patch

57 lines
3.1 KiB
Diff

diff --git a/lib/cjs/puppeteer/common/QueryHandler.js b/lib/cjs/puppeteer/common/QueryHandler.js
index db0ff2ee001ac452b6de5804ec8810e566992299..13437d905fe4fca94ad69e4e2fd95ba6b2cce89a 100644
--- a/lib/cjs/puppeteer/common/QueryHandler.js
+++ b/lib/cjs/puppeteer/common/QueryHandler.js
@@ -163,8 +163,7 @@ class QueryHandler {
return await frame.isolatedRealm().adoptHandle(elementOrFrame);
})(), false);
const { visible = false, hidden = false, timeout, signal } = options;
- const polling = options.polling ??
- (visible || hidden ? "raf" /* PollingOptions.RAF */ : "mutation" /* PollingOptions.MUTATION */);
+ const polling = visible || hidden ? "raf" /* PollingOptions.RAF */ : options.polling;
try {
const env_4 = { stack: [], error: void 0, hasError: false };
try {
diff --git a/lib/es5-iife/puppeteer-core-browser.js b/lib/es5-iife/puppeteer-core-browser.js
index 3262ea9f5fed2d0e3d7a0ece16ad31c7e5bc4cf6..f73deab795a92d80c913adafb6c3eff7eda5e5e0 100644
--- a/lib/es5-iife/puppeteer-core-browser.js
+++ b/lib/es5-iife/puppeteer-core-browser.js
@@ -4594,7 +4594,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
timeout,
signal
} = options;
- const polling = options.polling ?? (visible || hidden ? "raf" /* PollingOptions.RAF */ : "mutation" /* PollingOptions.MUTATION */);
+ const polling = visible || hidden ? "raf" /* PollingOptions.RAF */ : options.polling;
try {
const env_4 = {
stack: [],
diff --git a/lib/esm/puppeteer/common/QueryHandler.js b/lib/esm/puppeteer/common/QueryHandler.js
index b07ddf54fb1830c8ddc42dc6d0452b288696caa4..cb0203c7c1f98f03ea6658b33c8da3710ab71b29 100644
--- a/lib/esm/puppeteer/common/QueryHandler.js
+++ b/lib/esm/puppeteer/common/QueryHandler.js
@@ -160,8 +160,7 @@ export class QueryHandler {
return await frame.isolatedRealm().adoptHandle(elementOrFrame);
})(), false);
const { visible = false, hidden = false, timeout, signal } = options;
- const polling = options.polling ??
- (visible || hidden ? "raf" /* PollingOptions.RAF */ : "mutation" /* PollingOptions.MUTATION */);
+ const polling = visible || hidden ? "raf" /* PollingOptions.RAF */ : options.polling;
try {
const env_4 = { stack: [], error: void 0, hasError: false };
try {
diff --git a/src/common/QueryHandler.ts b/src/common/QueryHandler.ts
index f377771f22a193164760e703c2f3af123588ab16..db10e1cf94ada080c710f33d4dda6f4a116400fa 100644
--- a/src/common/QueryHandler.ts
+++ b/src/common/QueryHandler.ts
@@ -162,9 +162,7 @@ export class QueryHandler {
})();
const {visible = false, hidden = false, timeout, signal} = options;
- const polling =
- options.polling ??
- (visible || hidden ? PollingOptions.RAF : PollingOptions.MUTATION);
+ const polling = visible || hidden ? PollingOptions.RAF : options.polling;
try {
signal?.throwIfAborted();