WebKit JS

RSS for tag

Access and modify DOM elements within a webpage, including touch events and visual effects, using WebKit JS.

Posts under WebKit JS tag

200 Posts

Post

Replies

Boosts

Views

Activity

How can I prevent WKWebView initialization from hurting app startup time so much?
For many mid and large-size iOS apps, startup time is delayed by 100+ milliseconds due to 1 or more WKWebViews being created. This is usually due to 0-1 WKWebViews being created by first-party code and 1 or more different SDKs each creating their own WKWebView (IIRC for them to use a JS VM). Although SDK providers may not be willing (or able) to defer the creation of these WKWebViews past startup, I'm hopeful that there are still some ways to improve WKWebView creation time, and that I can share those ideas with them. Note that much of the time spent under the hood for WKWebView initialization seems to be on process pool creation and management. My ideas so far are: Defer WKWebView creation. This is an obvious one, but I generally want to look past it because SDKs are often unwilling to defer work like that and because it's going to cause frame drops whenever it does get loaded, even if not at startup. Use a shared WKProcessPool. Many companies wouldn't care all that much about sharing the same process space, so this would be a nice win Create the WKProcessPool or the WKWebViewConfiguration on a background thread (is this even safe to do?) Use some sort of lower-level API to run a JS VM, e.g. through WebKit2 directly, if such a public and stable API exists. Use JavaScriptCore. However, for reasons I can't recall, I believe this was a non-starter. It may have been JavaScriptCore's far slower performance, or the need to render actual web content. What are people's thoughts on these ideas? Does anyone have any other ideas?
0
0
933
Jul ’23
Webauthn with React in Safari
I am creating a react app and am making use of Webauthn to use TouchID or FaceID for user authentication. I have built my app so that when the button is clicked, navigator.credentials.create is the only call made. With attestation set to none, there are no issues however as soon as I set attestation to direct I get an alert saying 'The operation can't be completed' and 'NotAllowedError: This request has been cancelled by the user.' is logged to console. The issue only presents itself on Safari and iOS devices however works perfectly on other browsers like Chrome. Has anyone encountered a similar issue and possibly know how to resolve it? Thanks Shay
2
1
2.3k
Jun ’23
How add to clipboard image in browser on iPhone?
I'd like to add some image to clipboard from my web browser(Chrome, Safari) on iPhone. For example: I have canvas element with some picture. I get from the canvas element Blob type of data Create "ClipboardItem" with correct type and data Add to ClipboardItem to clipboard using write And on the MacBook, Windows laptops, Android devices, in chrome all correct work, but on iPhones nope (( Help me please, my code example here 👇🏻 canvasEl.toBlob((blob) => { if (!blob) return; navigator.clipboard.write([ new ClipboardItem({ "image/png": new Promise(async (resolve) => { resolve(new Blob([blob!], { type: "image/png" })); }), }), ]); });
0
0
1.2k
Jun ’23
event.preventDefault() call invalid autocorrect | Safari
Found a problem with Webkit. If in the safari browser, in the contenteditable field, using js, interrupt the keydown event and implement the same functionality programmatically, then the autoreplacement starts to produce incorrect results. As you can see in the image below, the content has been programmatically removed, but the autocorrect outputs incorrect options.
0
0
841
May ’23
Cannot get content height from UIWebView/WKWebView
Since iOS16.4 I cannot retrieve proper content height from my UIWebView. I've tried updating it to WKWebView but result is the same. I need to put this webView inside UITableViewCell so user will scroll through document using tableView scroll - not internal WebView scroll. To do this I need to set frame of webView to be the same as the whole document frame. I used to get height value from UIWebView like this: CGFloat documentHeight = [[webView stringByEvaluatingJavaScriptFromString:@"Math.max( document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);"] floatValue]; And accordingly from WKWebView: [webView evaluateJavaScript:@"Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);" completionHandler:^(id _Nullable height, NSError * _Nullable error) {} }]; Using Debug View Hierarchy I've found that WKWebView have many subviews of type WKCompositingView and the top of them have height equal to height of whole document. But this is internal view and I cannot get it in the correct way. I've check it with iOS16.5 and this issue still occurs. What can I do?
0
2
1.6k
Apr ’23
WKWebView configuration mediaTypesRequiringUserActionForPlayback not working after iOS 16.3.1 update
Hi, I am using WkWebView to display some dynamic content made in cocos creator game engine. For sound to play without user interaction I was using the "mediaTypesRequiringUserActionForPlayback" flag for WKWebViewConfiguration as '0' i.e. no user interaction is required to play audio/video. The above setting was working fine and sound autoplay was working up untill iOS 16.0, after updating my iPad to iOS 16.3.1 the autoplay of sound stopped working. It can only be played if I call AudioContext.resume() on user interaction. Can anyone advice how to get the audio autoplay working correctly again. Thanks
2
0
1.7k
Apr ’23
JSContext script syntax detection
Example async function test(){ ErrorCode }; await test() When I execute the script using JSContext, the syntax problem of the script cannot be detected WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; [webView callAsyncJavaScript:@"async function test(){ ErrorCode};await test()" arguments:NULL inFrame:WKFrameInfo.new inContentWorld:WKContentWorld.defaultClientWorld completionHandler:^(id _Nullable_result, NSError * _Nullable error) { NSLog(@"evalute javascript error %@",error.description); }]; [self.view addSubview:webView]; When I execute the script using WKWebView, I will get an error Can't find variable: ErrorCode But WKWebView doesn't support injecting JSExport, how can I do it
0
0
780
Apr ’23
I'd like to use a bridge from iOS swift to Vuejs/ts without window.handler. Please share your ideas and experience
Hi everyone. I am a new to iOS, and currently have a web view project with vue.js and typescript. I am facing the issue that I cannot call a typescript function in vue.js side from iOS if I do not use window.[handler] = { } in onMounted. I registered window.[handler] in main.ts to remove it from each vues, however, it didn't work. if I declare this code in each vue.js, then I don't have an issue in a local server(vuejs), but Jenkins gets this as an issue. If you have any opinions, experience or ideas, please share with me here. Thanks in advance.
1
0
1.1k
Apr ’23
iOS Safari does not respect URL provided via Web Share API (Navigator.Share(data)))
Hi Apple developers, I am building a web application (HTML/CSS/Javascript) which can be installed on any site. I would like to use the Web Share API to enable users to easily share a link to my application. Specifically I am using the Navigator.share(data) method (https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share) I am however running in to a number of issues on iOS and Safari, that I hope someone here can help answer, as I have not been able to find documentation, that supports/explains my findings. URL with query string parameters Let's assume my application is executing on domain-x.com. Using Navigator.share(data) I try to share a URL with query string parameters (simplified sample). onShareButtonClick(event) { Navigator.share({ url: "https://domain-x.com?somevariable=xyz", title: "Some Title" }); } When clicking the button which is hooked up to the eventhandler above, the share dialogue opens up correctly, but if I select sending via any message platform like Messenger, iMessage or other, the link being shared is without the query string - just https://domain-x.com. However if I click the Copy button, the full URL (https://domain-x.com?somevariable=xyz) is copied. URL different from application domain Let's assume my application is executing on domain-x.com. Using Navigator.share(data) I try to share a URL with another domain - domain-y.com (simplified sample). onShareButtonClick(event) { Navigator.share({ url: "https://domain-y.com/some-page", title: "Some Title" }); } When clicking the button which is hooked up to the eventhandler above, the share dialogue opens up correctly, but if I select sharing via any message platform like Messenger, iMessage or other, the link being shared is to the current page URL - eg. https://domain-x.com/current-page - not https://domain-y.com/some-page. However if I click the Copy button (again), the correct URL (https://domain-y.com/some-page) is copied. Do anybody know if this is the expected behavior on iOS? The share functionality works as expected on Android devices. I am thinking Apple is removing the query string parameters as part of their privacy initiatives. Is removing the ability to share URL's with other domains than the application is running on part of a similar strategy? Please help me with links or insights as to why this is happening - links to documentation or other forum posts are much appreciated - or am I simply doing something wrong? Thanks a lot in advance :)
6
1
4.4k
Apr ’23
Safari must log and show developers the errors from service workers for web extensions.
Hi, my Safari web extension produces an error in the published version, but not in my local development version. It is difficult to debug because Safari does not show the text of errors for service workers. Chrome does do this. The text of this error message is critical for developers. The extension is called Reveddit Real-Time and I converted it from an existing Chrome/Firefox extension using the guide "Converting a web extension for Safari". The bug I'm encountering does not exist in the Chrome/Firefox versions. After installing the App Store version on Safari, and granting approval for the necessary websites, it sometimes says "The service_worker script failed to load due to an error." Since the text of the error itself does not appear, I can't be sure what happened. If I reinstall, the extension may load, but it freezes when I click a link in the extension's popup. I believe the issue is with this line of code: browser.runtime.sendMessage({action: 'update-badge'}) (fired via a click event here) The bug only occurs when the background page is not loaded. That is indicated under "Develop -> Web Extension Background Pages -> reveddit real-time (not loaded)" Shouldn't a user action reload the extension automatically? I'm confused why the behavior is different on Safari and I wonder if Apple is still working on support for web extensions or not. Also, am I supposed to run xcrun, recreating the xcode project every time i want to update the code? It seems like this is the only way, but I'm worried this will somehow disconnect my project from the signing and uploading process I already went through. Thanks in advance.
0
1
1.5k
Apr ’23
Safari 16.4 Blobs - Sandbox Access Violation
Since upgrading to Safari 16.4 our React web app is having problems loading blobs that have worked fine for years. Only Safari 16.4 gives these errors, older safari, firefox, and chrome still work great with our web app and we have not touched this logic in years. The errors shown are: [Error] Refused to load blob:https://[ourSiteHere] because it does not appear in the frame-ancestors directive of the Content Security Policy. And: [Error] Sandbox access violation: Blocked a frame at "https://[ourSiteHere]" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. We added the allow-same-origin sandbox flag and tweaked the Content Securyity Policy, neither seem to improve the loading at all. The docs below mention "revoking Blob URLs across same-origin contexts" as well as 5 other mentions of updates to how blobs are loaded. Is there a bug somewhere in this new update to how blobs are handled or is there something we as developers need to do to update how we load our blobs to be able to show them like they have worked for years? https://webkit.org/blog/13966/webkit-features-in-safari-16-4/#html Also See: https://forums.macrumors.com/threads/ios-16-4-embedded-video-error-sandbox-error-on-browsers.2385213/
1
1
2.0k
Apr ’23
WkWebView changes the string being pasted
Hi, I just noticed something strange. When I call: webView?.paste("a://../../../123") (where webView is a WkWebView), the string that is pasted (that arrives in the JavaScript onPaste event handler) is: "a://../123". I think it has something to do with URL parsing. I would like to understand what is happening, and how to fix it.
0
0
1.1k
Apr ’23
WKWebView Micro auto muted in background
When my application goes into the background, the microphone I use in the webview via Webrtc is like muted by the system. When I put my app back in the foreground, the mics work again. To Reproduce: Build an iOS app with Background modes Audio, Airplay and Picture in Picture , Voice over IP and Background processing modes Load in thewebview a website using WebRTC to open the mic. Once the mic opened, Put your app in Background. You will see on the Control Panel as your mic is still used by the Webview but has been put to off Expected behavior: The micro must continue to works even in baclkground because i have all needed Background modes in the app. With Safari that works well, the micro continue to generate sample even if the app is in background Test on iOS : 15.7.3 and 16.3.1
1
3
1.2k
Mar ’23
WKURLSchemeHandler and fetch
I have an application that displays some HTML content with a WKWebView. I'm using a WKURLSchemeHandler attached to the webview configuration to respond to requests for local resources. This works as expected for img tags. I'm able to handle the requests for those images in my WKURLSchemeHandler instance and see the content displayed in the webview. However, when I try to load a resource with my custom scheme using fetch() I consistently get 3 subsequent error messages in the safari dev console. [blocked] The page at <my pages location> was not allowed to display insecure content from mycustomscheme://<some resource> Not allowed to request resource fetch cannot load mycustomscheme://<some resource> due to access control checks. It seems to be ambiguous in the documentation for WKURLSchemeHandler whether it should be able to service requests from fetch and/or XMLHttpRequest. Is this explicitly not supported or is there perhaps something I'm missing that would make this work?
2
0
2.3k
Mar ’23
Touch behavior is different between safari and PWA
I'm creating a PWA that has a finger drumming feature. I'm Using touchstart events to trigger playing sounds, I have touch-action: manipulation; on the container class and for all the triggering buttons. It works as expected inside Safari, but when installed as a PWA tapping twice quickly doesn't work and makes the app not usable. tapping twice works only if the interval between the taps is longer than ~300ms.
0
0
593
Mar ’23
How can I prevent WKWebView initialization from hurting app startup time so much?
For many mid and large-size iOS apps, startup time is delayed by 100+ milliseconds due to 1 or more WKWebViews being created. This is usually due to 0-1 WKWebViews being created by first-party code and 1 or more different SDKs each creating their own WKWebView (IIRC for them to use a JS VM). Although SDK providers may not be willing (or able) to defer the creation of these WKWebViews past startup, I'm hopeful that there are still some ways to improve WKWebView creation time, and that I can share those ideas with them. Note that much of the time spent under the hood for WKWebView initialization seems to be on process pool creation and management. My ideas so far are: Defer WKWebView creation. This is an obvious one, but I generally want to look past it because SDKs are often unwilling to defer work like that and because it's going to cause frame drops whenever it does get loaded, even if not at startup. Use a shared WKProcessPool. Many companies wouldn't care all that much about sharing the same process space, so this would be a nice win Create the WKProcessPool or the WKWebViewConfiguration on a background thread (is this even safe to do?) Use some sort of lower-level API to run a JS VM, e.g. through WebKit2 directly, if such a public and stable API exists. Use JavaScriptCore. However, for reasons I can't recall, I believe this was a non-starter. It may have been JavaScriptCore's far slower performance, or the need to render actual web content. What are people's thoughts on these ideas? Does anyone have any other ideas?
Replies
0
Boosts
0
Views
933
Activity
Jul ’23
How to know what's blocked by WKContentRuleList
As we know, we can use WKContentRuleList to block url requests/cookies or perform other actions in WKWebView. Is there any way that we can know what has been blocked by the WKWebView based on that WKContentRuleList?
Replies
2
Boosts
0
Views
1.9k
Activity
Jul ’23
Is there a way to block <script> elements with WKContentRuleList?
Is there a way to block certain embedded inline javascript elements using WKContentRuleList? For example <script> evilJavascriptHere </script> The documentation states that you can specify a url-filter but what about inline scripts?
Replies
0
Boosts
0
Views
755
Activity
Jun ’23
onPointer Events Not working on the ios Safari
onPointer Events not working on safari browser in IOS, when i hold on an element in ios it showing a context menu, but not getting the events.
Replies
0
Boosts
0
Views
863
Activity
Jun ’23
Webauthn with React in Safari
I am creating a react app and am making use of Webauthn to use TouchID or FaceID for user authentication. I have built my app so that when the button is clicked, navigator.credentials.create is the only call made. With attestation set to none, there are no issues however as soon as I set attestation to direct I get an alert saying 'The operation can't be completed' and 'NotAllowedError: This request has been cancelled by the user.' is logged to console. The issue only presents itself on Safari and iOS devices however works perfectly on other browsers like Chrome. Has anyone encountered a similar issue and possibly know how to resolve it? Thanks Shay
Replies
2
Boosts
1
Views
2.3k
Activity
Jun ’23
How add to clipboard image in browser on iPhone?
I'd like to add some image to clipboard from my web browser(Chrome, Safari) on iPhone. For example: I have canvas element with some picture. I get from the canvas element Blob type of data Create "ClipboardItem" with correct type and data Add to ClipboardItem to clipboard using write And on the MacBook, Windows laptops, Android devices, in chrome all correct work, but on iPhones nope (( Help me please, my code example here 👇🏻 canvasEl.toBlob((blob) => { if (!blob) return; navigator.clipboard.write([ new ClipboardItem({ "image/png": new Promise(async (resolve) => { resolve(new Blob([blob!], { type: "image/png" })); }), }), ]); });
Replies
0
Boosts
0
Views
1.2k
Activity
Jun ’23
event.preventDefault() call invalid autocorrect | Safari
Found a problem with Webkit. If in the safari browser, in the contenteditable field, using js, interrupt the keydown event and implement the same functionality programmatically, then the autoreplacement starts to produce incorrect results. As you can see in the image below, the content has been programmatically removed, but the autocorrect outputs incorrect options.
Replies
0
Boosts
0
Views
841
Activity
May ’23
Composition selection bug in contenteditable | Webkit
[IOS 16.4.1] I recently noticed that if there is a contenteditable field on the page in the browser and it is cleared during the touchstart event, then such a selection remains. I did not find any solution to this problem on the Internet. How can I fix this problem?
Replies
0
Boosts
0
Views
803
Activity
May ’23
Cannot get content height from UIWebView/WKWebView
Since iOS16.4 I cannot retrieve proper content height from my UIWebView. I've tried updating it to WKWebView but result is the same. I need to put this webView inside UITableViewCell so user will scroll through document using tableView scroll - not internal WebView scroll. To do this I need to set frame of webView to be the same as the whole document frame. I used to get height value from UIWebView like this: CGFloat documentHeight = [[webView stringByEvaluatingJavaScriptFromString:@"Math.max( document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);"] floatValue]; And accordingly from WKWebView: [webView evaluateJavaScript:@"Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);" completionHandler:^(id _Nullable height, NSError * _Nullable error) {} }]; Using Debug View Hierarchy I've found that WKWebView have many subviews of type WKCompositingView and the top of them have height equal to height of whole document. But this is internal view and I cannot get it in the correct way. I've check it with iOS16.5 and this issue still occurs. What can I do?
Replies
0
Boosts
2
Views
1.6k
Activity
Apr ’23
WKWebView configuration mediaTypesRequiringUserActionForPlayback not working after iOS 16.3.1 update
Hi, I am using WkWebView to display some dynamic content made in cocos creator game engine. For sound to play without user interaction I was using the "mediaTypesRequiringUserActionForPlayback" flag for WKWebViewConfiguration as '0' i.e. no user interaction is required to play audio/video. The above setting was working fine and sound autoplay was working up untill iOS 16.0, after updating my iPad to iOS 16.3.1 the autoplay of sound stopped working. It can only be played if I call AudioContext.resume() on user interaction. Can anyone advice how to get the audio autoplay working correctly again. Thanks
Replies
2
Boosts
0
Views
1.7k
Activity
Apr ’23
JSContext script syntax detection
Example async function test(){ ErrorCode }; await test() When I execute the script using JSContext, the syntax problem of the script cannot be detected WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; [webView callAsyncJavaScript:@"async function test(){ ErrorCode};await test()" arguments:NULL inFrame:WKFrameInfo.new inContentWorld:WKContentWorld.defaultClientWorld completionHandler:^(id _Nullable_result, NSError * _Nullable error) { NSLog(@"evalute javascript error %@",error.description); }]; [self.view addSubview:webView]; When I execute the script using WKWebView, I will get an error Can't find variable: ErrorCode But WKWebView doesn't support injecting JSExport, how can I do it
Replies
0
Boosts
0
Views
780
Activity
Apr ’23
I'd like to use a bridge from iOS swift to Vuejs/ts without window.handler. Please share your ideas and experience
Hi everyone. I am a new to iOS, and currently have a web view project with vue.js and typescript. I am facing the issue that I cannot call a typescript function in vue.js side from iOS if I do not use window.[handler] = { } in onMounted. I registered window.[handler] in main.ts to remove it from each vues, however, it didn't work. if I declare this code in each vue.js, then I don't have an issue in a local server(vuejs), but Jenkins gets this as an issue. If you have any opinions, experience or ideas, please share with me here. Thanks in advance.
Replies
1
Boosts
0
Views
1.1k
Activity
Apr ’23
iOS Safari does not respect URL provided via Web Share API (Navigator.Share(data)))
Hi Apple developers, I am building a web application (HTML/CSS/Javascript) which can be installed on any site. I would like to use the Web Share API to enable users to easily share a link to my application. Specifically I am using the Navigator.share(data) method (https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share) I am however running in to a number of issues on iOS and Safari, that I hope someone here can help answer, as I have not been able to find documentation, that supports/explains my findings. URL with query string parameters Let's assume my application is executing on domain-x.com. Using Navigator.share(data) I try to share a URL with query string parameters (simplified sample). onShareButtonClick(event) { Navigator.share({ url: "https://domain-x.com?somevariable=xyz", title: "Some Title" }); } When clicking the button which is hooked up to the eventhandler above, the share dialogue opens up correctly, but if I select sending via any message platform like Messenger, iMessage or other, the link being shared is without the query string - just https://domain-x.com. However if I click the Copy button, the full URL (https://domain-x.com?somevariable=xyz) is copied. URL different from application domain Let's assume my application is executing on domain-x.com. Using Navigator.share(data) I try to share a URL with another domain - domain-y.com (simplified sample). onShareButtonClick(event) { Navigator.share({ url: "https://domain-y.com/some-page", title: "Some Title" }); } When clicking the button which is hooked up to the eventhandler above, the share dialogue opens up correctly, but if I select sharing via any message platform like Messenger, iMessage or other, the link being shared is to the current page URL - eg. https://domain-x.com/current-page - not https://domain-y.com/some-page. However if I click the Copy button (again), the correct URL (https://domain-y.com/some-page) is copied. Do anybody know if this is the expected behavior on iOS? The share functionality works as expected on Android devices. I am thinking Apple is removing the query string parameters as part of their privacy initiatives. Is removing the ability to share URL's with other domains than the application is running on part of a similar strategy? Please help me with links or insights as to why this is happening - links to documentation or other forum posts are much appreciated - or am I simply doing something wrong? Thanks a lot in advance :)
Replies
6
Boosts
1
Views
4.4k
Activity
Apr ’23
Safari must log and show developers the errors from service workers for web extensions.
Hi, my Safari web extension produces an error in the published version, but not in my local development version. It is difficult to debug because Safari does not show the text of errors for service workers. Chrome does do this. The text of this error message is critical for developers. The extension is called Reveddit Real-Time and I converted it from an existing Chrome/Firefox extension using the guide "Converting a web extension for Safari". The bug I'm encountering does not exist in the Chrome/Firefox versions. After installing the App Store version on Safari, and granting approval for the necessary websites, it sometimes says "The service_worker script failed to load due to an error." Since the text of the error itself does not appear, I can't be sure what happened. If I reinstall, the extension may load, but it freezes when I click a link in the extension's popup. I believe the issue is with this line of code: browser.runtime.sendMessage({action: 'update-badge'}) (fired via a click event here) The bug only occurs when the background page is not loaded. That is indicated under "Develop -> Web Extension Background Pages -> reveddit real-time (not loaded)" Shouldn't a user action reload the extension automatically? I'm confused why the behavior is different on Safari and I wonder if Apple is still working on support for web extensions or not. Also, am I supposed to run xcrun, recreating the xcode project every time i want to update the code? It seems like this is the only way, but I'm worried this will somehow disconnect my project from the signing and uploading process I already went through. Thanks in advance.
Replies
0
Boosts
1
Views
1.5k
Activity
Apr ’23
Safari 16.4 Blobs - Sandbox Access Violation
Since upgrading to Safari 16.4 our React web app is having problems loading blobs that have worked fine for years. Only Safari 16.4 gives these errors, older safari, firefox, and chrome still work great with our web app and we have not touched this logic in years. The errors shown are: [Error] Refused to load blob:https://[ourSiteHere] because it does not appear in the frame-ancestors directive of the Content Security Policy. And: [Error] Sandbox access violation: Blocked a frame at "https://[ourSiteHere]" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. We added the allow-same-origin sandbox flag and tweaked the Content Securyity Policy, neither seem to improve the loading at all. The docs below mention "revoking Blob URLs across same-origin contexts" as well as 5 other mentions of updates to how blobs are loaded. Is there a bug somewhere in this new update to how blobs are handled or is there something we as developers need to do to update how we load our blobs to be able to show them like they have worked for years? https://webkit.org/blog/13966/webkit-features-in-safari-16-4/#html Also See: https://forums.macrumors.com/threads/ios-16-4-embedded-video-error-sandbox-error-on-browsers.2385213/
Replies
1
Boosts
1
Views
2.0k
Activity
Apr ’23
WkWebView changes the string being pasted
Hi, I just noticed something strange. When I call: webView?.paste("a://../../../123") (where webView is a WkWebView), the string that is pasted (that arrives in the JavaScript onPaste event handler) is: "a://../123". I think it has something to do with URL parsing. I would like to understand what is happening, and how to fix it.
Replies
0
Boosts
0
Views
1.1k
Activity
Apr ’23
MediaStreamTrack Video not update width/height remotely (works only if remote is Safari)
Using WebRTC to open Camera, and RTCPeerConnection to exchange MediaStream , the MediaStreamTrack Video coming from iPhone not update width/height remotely, width and height change only on safari remote browser but not on Chrome or Edge of other participants
Replies
0
Boosts
0
Views
758
Activity
Mar ’23
WKWebView Micro auto muted in background
When my application goes into the background, the microphone I use in the webview via Webrtc is like muted by the system. When I put my app back in the foreground, the mics work again. To Reproduce: Build an iOS app with Background modes Audio, Airplay and Picture in Picture , Voice over IP and Background processing modes Load in thewebview a website using WebRTC to open the mic. Once the mic opened, Put your app in Background. You will see on the Control Panel as your mic is still used by the Webview but has been put to off Expected behavior: The micro must continue to works even in baclkground because i have all needed Background modes in the app. With Safari that works well, the micro continue to generate sample even if the app is in background Test on iOS : 15.7.3 and 16.3.1
Replies
1
Boosts
3
Views
1.2k
Activity
Mar ’23
WKURLSchemeHandler and fetch
I have an application that displays some HTML content with a WKWebView. I'm using a WKURLSchemeHandler attached to the webview configuration to respond to requests for local resources. This works as expected for img tags. I'm able to handle the requests for those images in my WKURLSchemeHandler instance and see the content displayed in the webview. However, when I try to load a resource with my custom scheme using fetch() I consistently get 3 subsequent error messages in the safari dev console. [blocked] The page at <my pages location> was not allowed to display insecure content from mycustomscheme://<some resource> Not allowed to request resource fetch cannot load mycustomscheme://<some resource> due to access control checks. It seems to be ambiguous in the documentation for WKURLSchemeHandler whether it should be able to service requests from fetch and/or XMLHttpRequest. Is this explicitly not supported or is there perhaps something I'm missing that would make this work?
Replies
2
Boosts
0
Views
2.3k
Activity
Mar ’23
Touch behavior is different between safari and PWA
I'm creating a PWA that has a finger drumming feature. I'm Using touchstart events to trigger playing sounds, I have touch-action: manipulation; on the container class and for all the triggering buttons. It works as expected inside Safari, but when installed as a PWA tapping twice quickly doesn't work and makes the app not usable. tapping twice works only if the interval between the taps is longer than ~300ms.
Replies
0
Boosts
0
Views
593
Activity
Mar ’23