WebKit JS

RSS for tag

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

WebKit JS Documentation

Posts under WebKit JS tag

50 Posts
Sort by:
Post not yet marked as solved
0 Replies
84 Views
I am trying to migrate some of my mapkit code to the Map Server API. My JWT is fine and I can use that within the API Playground just fine. However, when I try to implement a test using PHP and cURL to get my Map token, I receive a 401 Not Authorized Error. My code is below: <?php $URL="https://maps-api.apple.com/v1/token"; $accesstoken = "<MY TOKEN HERE>"; $authorization = 'Authorization: Bearer'.$accesstoken; $headers = []; $ch = curl_init($URL); curl_setopt($ch, CURLOPT_HTTPHEADER, [$authorization]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$headers) { $len = strlen($header); $header = explode(':', $header, 2); if (count($header) < 2) // ignore invalid headers return $len; $headers[strtolower(trim($header[0]))][] = trim($header[1]); return $len; } ); $result=curl_exec($ch); $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code curl_close ($ch); print_r($headers); echo($result); echo($status_code); ?> Now the exact response that I am receiving is: Array ( [date] => Array ( [0] => Thu, 18 Apr 2024 18:32:15 GMT ) [content-type] => Array ( [0] => application/json;charset=utf8 ) [content-length] => Array ( [0] => 51 ) [connection] => Array ( [0] => keep-alive ) [cache-control] => Array ( [0] => max-age=0 ) [x-rid] => Array ( [0] => c9507281-bc32-46ac-be3b-dc59e97e7fed ) [strict-transport-security] => Array ( [0] => max-age=31536000; includeSubDomains; ) ) {"error":{"message":"Not Authorized","details":[]}} 401 Any help getting this to work would be appreciated.
Posted
by kmaynard.
Last updated
.
Post not yet marked as solved
0 Replies
60 Views
Hello Our app met issue after iOS 17.4 update. Native view works properly with App language setting. But WKWebview's language is set with general OS setting's language. In example, When OS language is Korean and App language is English, Native view is shown with English, but WKWebview is shown with Korean. We found that navigator.language is Korean. This problem has been occurring since iOS 17.4 version. If anyone knows anything about this issue, could you please share?
Posted Last updated
.
Post not yet marked as solved
0 Replies
287 Views
Even when iOS's '"." Shortcut' keyboard setting is enabled, double-tapping the spacebar in WKWebView doesn't insert a period. While making WKWebView editable , "." shortcut is not working. It works fine when any other external keyboard is used. I am facing this issue in WKWebView using apple keyboard. Even forceful adding javascript to replace double tap of space bar to period character logic is not working.
Posted
by Neel95.
Last updated
.
Post not yet marked as solved
0 Replies
147 Views
After insert this script I can't see the property window.app.isNative = true on Safari, What I'm missing here? Thanks in advance userContentController.addUserScript(WKUserScript(source: """function() { if (!window.app) { window.app = {}; } window.app.isAndroid = false; window.app.isIOS = true; window.app.isNative = true; originWhitelist={['*']} } """, injectionTime: .atDocumentStart, forMainFrameOnly: true))
Posted Last updated
.
Post marked as solved
4 Replies
312 Views
How to detect the location of a mouseDown event using Swift? With the following code snippet, I get the error "Cannot find type 'NSEvent' in scope"? import SpriteKit func mouseDown(with event: NSEvent) { if let ourScene = GameScene(fileNamed: "GameScene") { let location = event.location(in: view) let node:SKNode = ourScene.atPoint(location) if (node.name == "creditsInfo") { showCredits() } } // if let ourScene } // mouseDown Anybody have a floodlight to shine on this very basic error?
Posted
by JohnLove.
Last updated
.
Post not yet marked as solved
1 Replies
232 Views
Hi Team, We are working on one of the Acute Healthcare Imaging application and application is running under WKWebview controller. We have observed many crashes when GC doesn't get executed in timely manner. This is very critical healthcare app which has direct impact on patient care. Appreciate any guidance or direction to force GC or optimized dereferenced objects. Thanks in advance for your attnetion. -RA
Posted
by gent_boy.
Last updated
.
Post not yet marked as solved
0 Replies
402 Views
Hello community, first post I hope to meet the guidelines. I am developing a web site that uses a library that involves audio playback. This playback is accompanied by an animated canva, and in the IOS17 version in safari, this does not work. The audio is muted and the canva does not animate. However, in ios16 safari it works perfectly. I have also tried in safari on MacOs and ipadOs and it works, which makes me see that the problem is with ios 17 safari. The library in question is this: https://github.com/foobar404/Wave.js/ I don't think the failure is in the library since it works as I said in all other platforms. Specifically the code is here: https://github.com/foobar404/wave.js/blob/main/src/index.ts and makes me think that some HTML element is being incompatible. It is necessary to emphasize that in ios17 it does not work, but it does not appear any error in console. I would love to get help or know if this is a bug to report it.
Posted Last updated
.
Post not yet marked as solved
0 Replies
369 Views
Hi, After iOS 17 software update, we've encountered an anomaly with the video element within our videojs player. Upon video load, there's a noticeable shift and recentring of the video to its correct position. This issue becomes more pronounced when the player is in a horizontal orientation while the video being played is vertical. Additionally, we've observed resizing and cropping issues during the initialization of the player, which were not present in earlier versions. In our current implementation, we have a canvas element inserted before the player. Due to resizing, the video sticks to the canvas and fails to return to the correct position. <div> <video class="vjs-tech" webkit-playsinline playsinline src="hls video source"> </video> <canvas style="filter: blur(15px)" class="vjs-tech custom-canvas" width="412" height="320"> </canvas> </div>
Posted
by apratimb.
Last updated
.
Post not yet marked as solved
1 Replies
552 Views
Intercept WebView requests and add Auth token in all subsequent resource request [GET --> .js, .png, .css]. We have tried the below delegate methods and those call are not getting invoked. We have a challenge with Webview when load our application URL. func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) { func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { we are looking for some delegate or protocol to intercept the request to add the token for all the requests. is there any possible solution to fix this issue? Thanks
Posted
by sundar.
Last updated
.
Post not yet marked as solved
0 Replies
298 Views
I'm finding some issues with my iOS application that are related to the WebKit framework. I'm receiving the following errors in the application log: 01:05.995.258 Error Space Warhog (2434) com.apple.WebKit IPC 0x114088220 - Connection::dispatchIncomingMessages: IPC throttling was triggered (has 2'458 pending incoming messages, will only process 60 before yielding) 01:05.995.286 Error Space Warhog (2434) com.apple.WebKit IPC 0x114088220 - Connection::dispatchIncomingMessages: first IPC message in queue is WebUserContentControllerProxy_DidPostMessage It happens just when I make a purchase in the app. It does the whole process correctly (apparently), but once the "Purchase successful" pop up appears, the result is duplicated. If I make a second purchase, once I get the correct coins, the APP freezes and I have to restart it. Thank you for your help!
Posted
by konguele.
Last updated
.
Post not yet marked as solved
1 Replies
466 Views
WKWebView question...I've set up WKAppBoundDomains and am using limitsNavigationsToAppBoundDomains to enable evaluateJavaScript, Service Workers, etc. That's all working great. However, I'm no longer to able to load a WKWebView with any domain that is not one of the app-bound domains. For these other webviews, I don't need any of the special restricted APIs. I just want them to load and do basic website stuff. My impression from the docs is that this should be fine. Does it require explicitly setting config.limitsNavigationsToAppBoundDomains = false? Unfortunately I can't do that in all cases; some of the WKWebViews are created by external libraries where I can't edit the WKWebViewConfiguration Is there another step I need to take? Or, maybe something with a ContentWorld?
Posted
by jkadis.
Last updated
.
Post not yet marked as solved
0 Replies
493 Views
It didn't happen before upgrading to iOS 17. I can't find any posts about this yet so I post this one. On any browser(Safari, Chrome, Edge, ...), you activate the fullscreen mode of the video. And with dev console, or you add the event listener to "play" event, you run video.load() 2+ times. Then the size of the video is not as fullscreen. You can see this on Twitch because they use video.load() on their live streaming service so that they show the live moment of contents to users every time users hit the play button. When I pinch to zoom in or out or deactivate fullscreen mode, it gets back to fullscreen size. Has anyone experienced the same thing??
Posted
by junpark.
Last updated
.
Post not yet marked as solved
0 Replies
412 Views
We have a challenge with Webview when load our application URL. Initial call we are passing all the information with token and its works fine, but we are getting 401- unauthorized for some of the subsequent redirect request while loading webview. looks like server is expecting auth tokens for all the redirect/subsequent request. we are not able to intercept the request to add the token for all the requests. is there any possible solution to fix this issue? Thanks
Posted
by sundar.
Last updated
.
Post not yet marked as solved
1 Replies
398 Views
I have wkwebview, from it the camera is triggered, a photo is taken and uploaded to the web. 
The problem is that when the photo is taken nothing happens on the web, the camera just closes and that's it, the button in webview that opens the camera stops triggering until you re-enter the application. Permishen to use the camera is added. 

If you open through safari - everything works, android also has the expected behavior, but in webview ais does not want to load. Maybe something new has appeared in webview that needs to be enabled, given permission? Tryedto allow inlinedmediaplayback, allowArbitryLoads
Posted
by Empiric10.
Last updated
.
Post not yet marked as solved
0 Replies
432 Views
Problem Description: In the current scenario, I am dealing with a website platform that lacks traditional APIs for service access. To circumvent this limitation, the mobile application necessitates hosting a "web server" locally on "ws://127.0.0.1:****". The idea is that the website, loaded in a WKWebView, should establish a WebSocket connection with the locally hosted server. The responsibility for creating this WebSocket lies with the loaded website. I am utilizing "Telegraph" to set up the local server within the iOS application. To verify the functionality of the local Webserver, I attempted to establish a WebSocket connection to it outside of the WKWebView, and the connection was successfully established. Question: Despite the success of the direct WebSocket connection outside of WKWebView, I am encountering difficulties when attempting to establish the same connection within the WKWebView. Is this approach even feasible? If it is, could you kindly point out any potential oversights or provide guidance on what might be missing in my implementation? Your assistance in resolving this matter is greatly appreciated.
Posted Last updated
.
Post not yet marked as solved
0 Replies
391 Views
Currently I am using Objective-C and embedding a React website into the WKWebview. I have a component with scroll function and I also have some text description with an input component in the scroll function component. If the input component is shown all and I onClick the input component for inputting value in it, it works normally. However, when the input component shows only half of it and another half is hidden by the scroll component (Because it scrolls to see only half of the input component), it will triggers an unexpected issue that the WKWebview will have a white bar on the bottom and it will keep exists and affecting my UI. I have checked with web inspector that it is outside of the tag. Therefore, seems it is related to the issue with the external keyboard behaviour. Please provide some suggestion if anyone have any idea on this topic. Thanks a lot
Posted Last updated
.
Post not yet marked as solved
0 Replies
300 Views
I want to develop the application where I can able to capture and send the touch events like TAP,Press,Swipe etc from iphone to browser(Client) for remote support .can anyone suggest any method or API to capture Touch Events and the method to send on browser. Is there any document or link is available or support for the same
Posted Last updated
.