WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
254545
New Wake Lock API does not work in Home Screen Web Apps
https://bugs.webkit.org/show_bug.cgi?id=254545
Summary
New Wake Lock API does not work in Home Screen Web Apps
siim
Reported
2023-03-27 13:35:08 PDT
New Wake Lock API works in Safari browser but does not work when web page is added to home screen.
https://whatpwacando.today/wake-lock
Attachments
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2023-03-27 14:25:40 PDT
Thank you for filing the bug and the reproduction case. I'll investigate when I have some spare cycles. I have no idea why Home Screen web apps would behave differently than MobileSafari here.
Radar WebKit Bug Importer
Comment 2
2023-03-27 14:25:53 PDT
<
rdar://problem/107284303
>
siim
Comment 3
2023-03-27 14:28:12 PDT
Wake lock works: iOS Safari in browser iOS MS Edge in browser Wake lock does not work: iOS Safari added to home screen iOS MS Edge added to home screen iOS 16.4 iPhone 13
Chris Dumez
Comment 4
2023-03-27 14:29:24 PDT
(In reply to siim from
comment #3
)
> Wake lock works: > iOS Safari in browser > iOS MS Edge in browser > > Wake lock does not work: > iOS Safari added to home screen > iOS MS Edge added to home screen > > > iOS 16.4 > iPhone 13
One difference I can think of is WKWebView vs SafariViewController.
Jesper Bendtsen
Comment 5
2023-03-28 09:32:21 PDT
I have experienced the same thing, it works in Safari browser, but not in installed PWA. iPhone 11 - iOS 16.4 iPad prod 2020 - iOS 16.4
Marcos Caceres
Comment 6
2023-03-29 19:13:10 PDT
Came up here to:
https://bugs.webkit.org/show_bug.cgi?id=205104#c8
With another test case:
https://pelord.github.io/wakeLockApiAddHomeScreen/
siim
Comment 7
2023-04-12 13:37:01 PDT
Also Wake Lock API does not work with "visibilitychange" event. Unable to re set wake lock api after user goes to home screen and back to Safari. NotAllowedError: Permission was denied
https://github.com/mdn/dom-examples/blob/main/screen-wake-lock-api/script.js
This example works fine in Android & Windows.
Chris Dumez
Comment 8
2023-04-12 13:38:00 PDT
(In reply to siim from
comment #7
)
> Also Wake Lock API does not work with "visibilitychange" event. > > Unable to re set wake lock api after user goes to home screen and back to > Safari. > > NotAllowedError: Permission was denied > >
https://github.com/mdn/dom-examples/blob/main/screen-wake-lock-api/script.js
> > This example works fine in Android & Windows.
Please file a separate bug since this is a separate issue (please cc me).
siim
Comment 9
2023-04-12 14:05:33 PDT
(In reply to Chris Dumez from
comment #8
)
> Please file a separate bug since this is a separate issue (please cc me).
https://bugs.webkit.org/show_bug.cgi?id=255363
Chris Dumez
Comment 10
2023-04-25 10:24:48 PDT
We rely on the following code to keep the screen awake on iOS: ``` [UIApplication sharedApplication].idleTimerDisabled = YES; ``` This likely does't work in Home Screen Web Apps because they are not UIApplications but ViewServices. Looks like we need to find an alternate way to make this work for such apps.
Chris Dumez
Comment 11
2023-04-25 16:58:07 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/13179
EWS
Comment 12
2023-04-26 10:59:54 PDT
Committed
263419@main
(bf7f0d4d340b): <
https://commits.webkit.org/263419@main
> Reviewed commits have been landed. Closing PR #13179 and removing active labels.
PE Lord
Comment 13
2023-05-19 13:09:44 PDT
The fix do not seem to have landed into iOS 16.5 ... :(
Chris Dumez
Comment 14
2023-05-19 13:15:42 PDT
(In reply to PE Lord from
comment #13
)
> The fix do not seem to have landed into iOS 16.5 ... :(
This is true. I should also mention that the fix isn't in WebKit. We added API to WebKit to allow the Safari team to fix this (and thus closed this WebKit bug report). However, the issue won't be resolved until Safari actually adopts the new WebKit API.
Jesper Bendtsen
Comment 15
2023-07-26 00:10:24 PDT
in iOS 16.6 it doesn't work either :( fingers crossed for iOS 17...
siim
Comment 16
2023-08-22 22:56:16 PDT
Still not fixed in iOS 17 beta 7.
siim
Comment 17
2023-09-13 00:34:56 PDT
Still not fixed in iOS 17 RC
Vince
Comment 18
2023-09-13 12:47:30 PDT
Just installed iOS 17 Beta on iPad, and still doesn't work.
siim
Comment 19
2023-09-25 04:12:17 PDT
Still not fixed in iOS 17.0.1. I guess it will be never fixed. What a waste of time.
Chris Dumez
Comment 20
2023-09-25 12:02:49 PDT
WebKit is providing API for Safari to adopt. No further code change is expected in WebKit so there is no point in keeping this WebKit bug open.
Alexey Proskuryakov
Comment 21
2023-09-25 12:05:04 PDT
Please report this
https://feedbackassistant.apple.com
for better visibility within Apple. You are also welcome and encouraged to comment here, however that's not as good as reporting feedback in the right place.
siim
Comment 22
2023-09-25 12:18:40 PDT
(In reply to Alexey Proskuryakov from
comment #21
)
> Please report this
https://feedbackassistant.apple.com
for better visibility > within Apple. > > You are also welcome and encouraged to comment here, however that's not as > good as reporting feedback in the right place.
This website does not work with other browsers: VM95:1 Uncaught (in promise) SyntaxError: Unterminated string in JSON at position 993 (line 1 column 994)
https://i.imgur.com/Ml5VgKU.png
siim
Comment 23
2023-09-25 12:23:45 PDT
Also broken in Safari.(In reply to Alexey Proskuryakov from
comment #21
)
> Please report this
https://feedbackassistant.apple.com
for better visibility > within Apple. > > You are also welcome and encouraged to comment here, however that's not as > good as reporting feedback in the right place.
Also broken in Safari. Please test your links before recommending them here...
Chris Dumez
Comment 24
2023-09-25 12:28:27 PDT
(In reply to siim from
comment #23
)
> Also broken in Safari.(In reply to Alexey Proskuryakov from
comment #21
) > > Please report this
https://feedbackassistant.apple.com
for better visibility > > within Apple. > > > > You are also welcome and encouraged to comment here, however that's not as > > good as reporting feedback in the right place. > > Also broken in Safari. > > Please test your links before recommending them here...
This site is working fine for me both in Safari and Chrome. The issue you're seeing could be caused by a browser extension. If not, I'm unsure what the issue is.
https://feedbackassistant.apple.com
is the main Apple website to file bugs and we do get a lot of bugs report from this site.
siim
Comment 25
2023-09-25 12:35:17 PDT
I do not have any extensions on Safari. I guess they do not want regular users feedback :)
siim
Comment 26
2023-09-25 12:39:59 PDT
https://i.imgur.com/RgU2eNC.png
Same JSON parse error in Safari: Unhandled Promise Rejection: SyntaxError: JSON Parse error: Unterminated string SyntaxError: JSON Parse error: Unterminated string
Chris Dumez
Comment 27
2023-09-25 12:42:03 PDT
(In reply to siim from
comment #26
)
>
https://i.imgur.com/RgU2eNC.png
> > Same JSON parse error in Safari: > Unhandled Promise Rejection: SyntaxError: JSON Parse error: Unterminated > string > SyntaxError: JSON Parse error: Unterminated string
At what step do you get this error?
siim
Comment 28
2023-09-25 12:52:22 PDT
(In reply to Chris Dumez from
comment #27
)
> At what step do you get this error?
2 seconds after login and I can see unread iOS beta news and then it crashes to blank page.
siim
Comment 29
2023-09-25 13:58:36 PDT
Managed to get screenshot before crash. I guess untitled feedback is corrupted.
https://i.imgur.com/A39si4s.png
siim
Comment 30
2023-09-25 14:35:30 PDT
This feedback website is broken in iOS 17 iPhone 13 also. Managed to add new feedback and choose iOS/iPad and after that it crashes to blank screen.
Jen Simmons
Comment 31
2023-09-26 09:51:06 PDT
rdar://108573133
Jen Simmons
Comment 32
2023-09-26 11:33:35 PDT
Closing this again, because the work needed in the WebKit engine is in fact complete. Web apps are interesting because they involve both the browser engine and other kinds of browser technology / operating system technology. Wake Lock API does not yet work in Home Screen Web Apps. We are aware; this is not unexpected. The work that's still needed for a complete fix _is_ being tracked and discussed — just not in the WebKit project, since the WebKit portion is done. Stay tuned.
PE Lord
Comment 33
2023-12-14 10:02:01 PST
Does this fix in webkit has landed in iOS 17.2?
siim
Comment 34
2023-12-15 00:49:30 PST
No Still broken
Jesper Bendtsen
Comment 35
2023-12-17 00:06:28 PST
I'm really waiting for this to work in web apps, have been playing hidden video for years as a workaround. The downside with this method is that the video title and play and pause buttons appear on the front on iOS devices. Not cool. So Apple please prioritize this, been waiting since iOS 16.4 for a fix for web apps. The WebKit team has done their work a long time ago…
Danny Moerkerke
Comment 36
2024-01-09 13:44:40 PST
How can we report this to Apple? Otherwise this will probably never be fixed :-(
Marcos Caceres
Comment 37
2024-01-09 17:16:44 PST
Reopening... and don't don't worry, Apple people (e.g., me) do monitor these things. I'll check to see what's going on as this has possibly regressed.
Chris Dumez
Comment 38
2024-01-09 18:34:43 PST
@Marcos: There is no issue to fix on WebKit side, therefore there is no reason to have a WebKit bugzilla bug. There is already a radar and it is already assigned to the correct team at Apple. This issue was not forgotten.
Chris Dumez
Comment 39
2024-01-09 18:35:14 PST
(In reply to Danny Moerkerke from
comment #36
)
> How can we report this to Apple? Otherwise this will probably never be fixed > :-(
feedbackassistant.apple.com is how people report bugs to Apple.
Marcos Caceres
Comment 40
2024-01-09 19:09:18 PST
Oh yeah, oops. Sorry, Chris. Forgot we’d already suggested that.
siim
Comment 41
2024-01-17 23:30:22 PST
Still not fixed in iOS 17.3.
siim
Comment 42
2024-02-08 02:37:41 PST
It is fixed in iOS 17.4 by removing PWA support entirely... No PWA, no problem.
https://www.theregister.com/2024/02/08/apple_web_apps_eu/
siim
Comment 43
2024-02-15 12:14:37 PST
It is official now. Home Screen Apps are just bookmarks in iOS. Thanks all @apple.com developers here for helping to kill open web.
https://open-web-advocacy.org/blog/apple-on-course-to-break-all-web-apps-in-eu-within-20-days/
PE Lord
Comment 44
2024-03-25 08:37:06 PDT
They finally changed their mind.
https://bugs.webkit.org/show_bug.cgi?id=268643#c50
siim
Comment 45
2024-04-02 09:04:39 PDT
The bug had its one-year anniversary last month. Thanks Apple
Dwayne Macgowan
Comment 46
2024-06-30 07:44:11 PDT
i'm having this issue on iPhone 14, iOS 17.5.1
Sean Ray Dvir
Comment 47
2024-09-04 06:10:53 PDT
This bug still exists in the latest version of iOS. Any updates? Something to let us at least hope for a future where we can ship web apps properly on iOS?
ik
Comment 48
2024-09-26 11:47:37 PDT
"There is already a radar and it is already assigned to the correct team at Apple. This issue was not forgotten."
https://bugs.webkit.org/show_bug.cgi?id=254545#c38
That was 9 months ago. iOS 16.4 was released 18 months ago. Would be nice if someone could send a memo or something to that team? I mean, I imagine WebKit folks who worked on this feature would like their colleagues to take their work seriously and fix this? < Sorry for sounding snarky, but it would be a shame to have this take 3 years like fixing background audio in web apps did. >
William J. Edney
Comment 49
2024-10-04 07:37:12 PDT
Looks like this is still not fixed in iOS 18.0 Can others verify? Continuing to use the 'video element' hack for now, but its hacky and leaves detritus on the lock screen. Any update Apple folks? Cheers, - Bill
Carlos Lopez
Comment 50
2024-10-08 07:53:40 PDT
Video playback no longer works as a suitable fallback. An iPad will dim and lock regardless. This has completely degraded the state of our application. I have about 40 upset users who will need to migrate to Android devices.
webkit
Comment 51
2024-11-08 10:09:48 PST
I'm also encountering this issue in a PWA that I am developing. I need the screen to stay awake because the user is reading a document while operating an instrument with both hands with no opportunity to send input that would keep the screen at normal brightness.
webkit
Comment 52
2024-11-08 10:23:51 PST
This bug is still present in iOS 18.1 for installed PWA apps / bookmarked sites. The wakelock works when the page is running in Safari, but does not work when the app / page was opened from the home screen. A simple way to confirm this is to try the 'Enable Wake Lock' button on this page:
https://progressier.com/pwa-capabilities/screen-wake-lock
from safari (works) and from a page opened from the home screen (does not work).
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