Summary: | New Wake Lock API does not work in Home Screen Web Apps | ||
---|---|---|---|
Product: | WebKit | Reporter: | siim <webkit> |
Component: | New Bugs | Assignee: | Chris Dumez <cdumez> |
Status: | REOPENED --- | ||
Severity: | Normal | CC: | af, boris.brudnoy, cdumez, cryze92, drmoerkerke, dwaynemac, ggaren, jensimmons, jesperbendtsen83, marcosc, me, pierre-etienne.lord, tomac, vtremblay-lavoie, webkit-bug-importer, zazi.dx |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 17 | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Description
siim
2023-03-27 13:35:08 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. 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 (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. 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 Came up here to: https://bugs.webkit.org/show_bug.cgi?id=205104#c8 With another test case: https://pelord.github.io/wakeLockApiAddHomeScreen/ 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. (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). (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 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. Pull request: https://github.com/WebKit/WebKit/pull/13179 Committed 263419@main (bf7f0d4d340b): <https://commits.webkit.org/263419@main> Reviewed commits have been landed. Closing PR #13179 and removing active labels. The fix do not seem to have landed into iOS 16.5 ... :( (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. in iOS 16.6 it doesn't work either :( fingers crossed for iOS 17... Still not fixed in iOS 17 beta 7. Still not fixed in iOS 17 RC Just installed iOS 17 Beta on iPad, and still doesn't work. Still not fixed in iOS 17.0.1. I guess it will be never fixed. What a waste of time. 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. 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. (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 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... (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. I do not have any extensions on Safari. I guess they do not want regular users feedback :) 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 (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? (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. Managed to get screenshot before crash. I guess untitled feedback is corrupted. https://i.imgur.com/A39si4s.png 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. 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. Does this fix in webkit has landed in iOS 17.2? No Still broken 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… How can we report this to Apple? Otherwise this will probably never be fixed :-( 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. @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. (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. Oh yeah, oops. Sorry, Chris. Forgot we’d already suggested that. Still not fixed in iOS 17.3. 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/ 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/ They finally changed their mind. https://bugs.webkit.org/show_bug.cgi?id=268643#c50 The bug had its one-year anniversary last month. Thanks Apple i'm having this issue on iPhone 14, iOS 17.5.1 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? |