Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(page): emulate idle state #6410

Merged
merged 16 commits into from Sep 14, 2020
Merged

feat(page): emulate idle state #6410

merged 16 commits into from Sep 14, 2020

Conversation

sadym-chromium
Copy link
Collaborator

@sadym-chromium sadym-chromium commented Sep 10, 2020

  • https://bugs.chromium.org/p/chromium/issues/detail?id=1090802
  • added page.emulateIdleState(...) allowing emulate or remove emulation of the idle state;
  • added test emulate idle -> remove emulation -> emulate idle -> remove emulation;
  • added launch argument --enable-blink-features=IdleDetection to turn IdleDetection on.

sadym-chromium and others added 2 commits September 10, 2020 10:06
* https://bugs.chromium.org/p/chromium/issues/detail?id=1090802
* added `page.setIdleOverride(...)`;
* added `page.clearIdleOverride()`;
* added tests;
* added launch argument `--enable-blink-features=IdleDetection` to turn IdleDetection on.
src/common/Page.ts Outdated Show resolved Hide resolved
src/common/Page.ts Outdated Show resolved Hide resolved
Copy link
Member

@mathiasbynens mathiasbynens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation LGTM. I left some comments mostly wanting to discuss the Puppeteer-level API. There is no need to match the CDP API directly — we should try to provide the most user-friendly API possible (which in most cases is somewhat different from the CDP one).

@OrKoN OrKoN dismissed mathiasbynens’s stale review September 11, 2020 12:38

Changes have been implemented

Copy link
Member

@mathiasbynens mathiasbynens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % some final requests

src/node/Launcher.ts Outdated Show resolved Hide resolved
test/idle_override.spec.ts Show resolved Hide resolved
@sadym-chromium sadym-chromium changed the title feat(page): support IdleOverrides feat(page): emulate idle state Sep 14, 2020
src/node/Launcher.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants