Comment 71 for bug 604635

Revision history for this message
In , Jonas-sicking (jonas-sicking) wrote :

I agree with cjones. If the use-case isn't for apps to be able to see if they have the lock, I'd prefer to let the requestWakeLock implementation talk directly to the platform which can then handle everything based on user settings.

Does this mean that we can remove the callbacks too then?

I'd still like to understand the topic-string. Without it it seems like the API becomes as simple as:

navigator.wakeLockRequested = true/false;

let haveIRequestedWakeLock = navigator.wakeLockRequested;

Note that the latter doesn't return true/false depending on if the app has the lock, but simply lets you check if you have requested it.