question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] changing visibilityState

See original GitHub issue

Being able to change document.visibilityState (and consequently document.hidden) would be nice:

  • to test what some code does when hidden, prerender or visible
  • to test visibilitychange events and how code behave w.r.t. those properties

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kapouercommented, Mar 19, 2020

It should work with Object.defineProperty(document, 'visibilityState', {get() { return "prerender";}}) i don’t know why i opened that issue. Closing.

0reactions
nowayXcommented, Oct 8, 2020

Can you tell me how you changed the visibilityState with some code please

Read more comments on GitHub >

github_iconTop Results From Across the Web

Document.visibilityState - Web APIs - MDN Web Docs - Mozilla
visibilityState read-only property returns the visibility of the document, ... When the value of this property changes, the visibilitychange ...
Read more >
Page Visibility Level 2 - W3C
The Page Visibility API defines a means to programmatically determine the visibility state of a top-level browsing context, and to be notified ...
Read more >
visibilityState · WebPlatform Docs
Returns the visibility state of a webpage. ... var visibilityState = document. ... Use the visibilitychange property to track changes to the visibility...
Read more >
document.visibilityState set to “hidden” when WebContents is ...
Thanks to the WebContents Occlusion feature in Chromium, the Page Visibility Web API will now reflect accurately the visibility state of web ...
Read more >
Document.visibilityState - Web APIs
Note: This was removed from the standard. Check compatibility table for details. When the value of this property changes, the visibilitychange event is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found