[Feature] changing visibilityState
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
visibilitychangeevents and how code behave w.r.t. those properties
It should work with
Object.defineProperty(document, 'visibilityState', {get() { return "prerender";}})
i don't know why i opened that issue.
Closing.
@kapouer can you please put the snap of the code where you implemented this. Need to do same.
@abhayp5 https://github.com/kapouer/express-dom/blob/ef720a5b84e834ff951b9241788b63285c00e59b/lib/plugins.js#L98-L105 but there are tons of examples like that
thank you it really helped. able to achieve using page.evaluateHandle() function.
Can you tell me how you changed the visibilityState with some code please