Re: [screen-wake-lock] Be able to query if there are any screen wake-lock object active for the current page (#273)

The bookmarklet was just where I started but putting something on the window is messing with another apps state and I can't be 100% sure I would be overwriting something they needed (however unlikely).

The area that I was more interested in was the Web Component I was going to create for our partners so that they could toggle a screen wakelock on and off. The problem is that the WC should be isolated from having to understand the apps logic and state but it you would expect it to reflect the tab's state (if the page has a wake-lock that the WC didn't set it should be able to toggle on) so while I can set a wake lock and remove it inside the WC, there is no for a wake-lock that is already set in another component or part of the page to be discovered, or unset.

I don't quite agree with Jakes argument that one lock shouldn't be able to change anothers, because when the tab is changed the lock will be removed from all instances on that tab. It felt odd to me that a piece of code could set a lock and it never be unset unless you have access to the sentinel instance (which is why I was thinking about the removeAll style function that can remove all of a tabs locks).



-- 
GitHub Notification of comment by PaulKinlan
Please view or discuss this issue at https://github.com/w3c/screen-wake-lock/issues/273#issuecomment-675497156 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 18 August 2020 14:02:23 UTC