WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
255363
Wake Lock permission denied after visibilitychange
https://bugs.webkit.org/show_bug.cgi?id=255363
Summary
Wake Lock permission denied after visibilitychange
siim
Reported
2023-04-12 13:59:50 PDT
Wake Lock releases when app is not visible. This is expected and is same in all platforms (iOS, Android, Windows) document.visibilitychange event is used to aquire wake lock after user has started using app again. In iOS Wake Lock does not work after "visibilitychange" event to re-aquire wake lock if user *goes to home screen*. If apps are changed *without going to home screen*, then wake lock is re-aquired or stays active. Error message: NotAllowedError: Permission was denied Expected result: There should be permission to re-aquire wake lock after going back to home screen & back to Safari. There are no permission errors in Android or Windows. Example:
https://mdn.github.io/dom-examples/screen-wake-lock-api/
Code:
https://github.com/mdn/dom-examples/blob/main/screen-wake-lock-api/script.js
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-04-19 14:00:21 PDT
<
rdar://problem/108279602
>
Chris Dumez
Comment 2
2023-04-24 09:04:14 PDT
This is because we require transient activation to request the wake lock. When you're calling request() from the visibility change handler, you don't have transient activation.
Chris Dumez
Comment 3
2023-04-24 10:08:23 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/13104
EWS
Comment 4
2023-04-25 10:33:43 PDT
Committed
263382@main
(d901ad78bdb6): <
https://commits.webkit.org/263382@main
> Reviewed commits have been landed. Closing PR #13104 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug