Explore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.

General Documentation

Post

Replies

Boosts

Views

Activity

run Javascrip on Safari
Hello, I am experiencing an issue when running a script on Safari, specifically WebKit. Here is a sample HTML code: <!DOCTYPE html> <html lang="en"> <head> <script> function delayedFocus(e) { e.preventDefault(); setTimeout(function() { e.target.focus(); }, 1000); // Adjust the delay time as needed (in milliseconds) } </script> </head> <body> <ul> <li> <input type="text" id="testtext" onmousedown="delayedFocus(event)"> </li> </ul> </body> </html> The logic behind this script is to introduce a 1-second delay when the user clicks on the textbox. After 1 second, the keyboard should appear. Testing on Android mobile devices shows the expected behavior. However, on iPhones, the textbox receives focus, but the keyboard does not appear. This issue has been observed on various iOS versions, with the script working only on iOS 15. If you have any insights or solutions to address this compatibility issue, it would be greatly appreciated. Thank you.
0
0
452
Feb ’24
Safari extension distributed in a notarized app with Developer ID rejected by the browser
Hi folks, We're building a Safari web extension and experiencing an issue to see it among extensions in Safari after installing the container app to /Applications and launching it. The app and extension is notarized and signed with Developer ID After an extensive investigation, we found the following log records in the Console app (the extension ID is redacted): Computing the code signing dictionary failed for extension with identifier com.youcompany.safariext Blocking extension with identifier: com.youcompany.safariext To debug the issue, we've created a HelloWorld-like extension generated by Xcode 12.2 beta 4 (http s://sharedartifacts.s3.eu-central-1.amazonaws.com/safariext.app.zip contains a signed app bundle) It also is under the same code signing issue. According to https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/resolving_common_notarization_issues, we've run a few checks to verify: code signature ➜&#9;Desktop codesign -vvv --deep --strict ./safariext.app&#9;&#9;&#9;&#9;&#9; ...-prepared:/Users/nikolay/Desktop/safariext.app/Contents/PlugIns/safariext Extension.appex ...-validated:/Users/nikolay/Desktop/safariext.app/Contents/PlugIns/safariext Extension.appex ... ./safariext.app: valid on disk ./safariext.app: satisfies its Designated Requirement signing certificate ➜&#9;Desktop spctl -vvv --assess --type exec ./safariext.app&#9;&#9; ./safariext.app: accepted source=Notarized Developer ID origin=Developer ID secure timestamp ... Timestamp=25 Nov 2020 at 22:23:54 ... We seemed to have all checks good, the extension can be installed only if Safari is allowed to run unsigned extensions. Could anyone assist to debug/resolve this issue? Thanks
14
1
3.3k
Nov ’20
TCC permissions for Safari App Extensions incorrectly displayed in Security & Privacy preferences
Hi, We provide a Safari App Extension to our customers. It follows the standard Safari Extension App layout - the Extension is inside the App, the App takes care of installing the Extension in Safari. The Extension requires the Input Monitoring and Screen Recording permissions to be granted from the user. At some point during its execution, the Extension runs the code that triggers the TCC permission prompt. When the user goes to Security & Privacy Preferences dialog and clicks on the checkbox next to the Extension entry to grant the permission, the checkbox remains unchecked, however, the permissions are actually granted. This is the issue, and it is confusing for the user. Moreover, if the user decides not to grant the permissions (closes the initial prompt by clicking on the 'Deny' button) s/he will be prompted again when the Extension runs the next time (and every time). The App that contains the Extension does not suffer the same problem. Its entry in Security & Privacy Preferences responds correctly to checking/unchecking the checkbox. Unfortunately, the permissions granted to the app do not apply to the Extension contained within. Querying the main TCC database (/Library/Application Support/com.apple.TCC/TCC.db) shows one kTCCServiceListenEvent entry for the app, identified by its BundleID (permissions granted). For the Extension there are two entries - one identified by the the BundleID (permissions granted) and the other identified by the path to the Extension (permissions not granted). kTCCServiceListenEvent|/Volumes/Common/Sandboxes/Monterey/AppExtPermissons/DerivedData/AppExtPermissons/Build/Products/Debug/AppExtPermissons.app/Contents/PlugIns/AppExtPermissons Extension.appex|1|0 kTCCServiceListenEvent|com.gemalto.AppExtPermissons|0|2 kTCCServiceListenEvent|com.gemalto.AppExtPermissons.Extension|0|2 The system logs show some tccd-related errors when trying to check the checkbox: Console logs when trying to grant permissions We suspect this might be the reason why the checkbox next to the Extension entry under Input Monitoring in Security & Privacy does not respond to clicks. The same problem applies to granting Screen Recording permissions to the Extension. I constructed a minimal example based on the default Safari App Extension project - basically only added code that would trigger the permission granting prompt in the App and the Extension. Can provide a link to a zip if deemed useful. Are we doing something wrong, maybe missing an ID or a plist string somewhere?
0
0
361
Jan ’24
Link cant be opened inside iframe
Hi, I have a mobile app that uses iframe to show the html content. I noticed that the link cant be opened on the IOS but its works well on android. Here's general example html code: <iframe id="view-html-viewer-iframe" src="about:blank" frameborder="0"> ... <p><a href="https://google.com/" target="_parent">Google</a></p> ... </iframe> Anyone encounter the same issue.? is there any solution for this.? Thanks.
0
1
438
Jan ’24
Custom UI and gracefully failing the .pkg installation
We have an app that is distributed in our .pkg installer (using pkgbuild and productbuild). Now we need to perform various system checks, eg. minimum macOS version and then continue or abort the installation, based on conditions. When we do that in the pre-install script, it works but the user experience is not what we need. The installation aborts with a generic message. What we want is to show the progress, eg. which checks have failed and why, a link to open the installation log, and to gracefully exit the installation. Is it possible to achieve all this without resorting to writing a custom installation mac app ?
0
1
494
Jan ’24
Safari iOS Browser Auto-Navigation Issue During OTP Input
Steps to Reproduce: Open Safari browser on an iOS device. Navigate to a webpage requiring OTP input for authentication. Request OTP and wait for the SMS containing the code. When the SMS is received, Safari browser attempts to read the OTP automatically. The suggested OTP is displayed, and upon selecting it, the browser navigates to the previous screen or page. The navigation triggers the current screen button, preventing the entered OTP from being applied. IOS version: 17.0.3 Expected Behavior: After selecting the suggested OTP, Safari should not automatically navigate to the previous screen/page, and the entered OTP should be successfully applied to the authentication process. Actual Behavior: Safari browser on iOS automatically navigates to the previous screen/page after selecting the suggested OTP, preventing successful entry of the OTP.
0
0
230
Jan ’24
Safari Web Extension allow external connection from any website
Hey! We are developing a Safari Web Extension which requires the background script for localhost Web Socket communication (it doesn't work if we try to connect from the injected content script), everything works fine but we need it to be accessible from any URL since we have a SDK that is distributed to the customers and the domain name depends on each of them, is there a way to do this? Or is there any workaround to not have to use browser.runtime.connect or browser.runtime.sendMessage for communication between the injected content script and the background script? We have tried to use <all_urls> but that's not allowed for externally_connectable. Thanks!
1
1
399
Jan ’24
Universal Link Causing Too Many Redirects
I was wondering if anyone else ran into a similar problem. We have an universal link that leads to out iOS application. If we use the link by itself everything works properly. On to the problem. We run some campaigns that utilise universal links to redirect users to the application directly from the email. The emails are using click tracking, which means that they put the universal link behind another link. So it goes like this: User clicks link in the email User gets redirected to click tracking link User is redirected to the universal link Expected: App opens; Actual: User gets too many redirects error. The weird thing about this issue is that if, after clicking on the link from email app, user chooses to open link in Safari, they get too many redirects. But if they choose Open In Default Browser (which is also safari btw) then it works and opens the app. Any help here will be much appreciated since we tried everything we can think of and this problem still persists.
0
0
260
Jan ’24
touch events do not work in ipad air and pro
what happened? i never noticed it until i decided to use ipad air and pro as option in chrome dev console mobile view as well as ios simulator. it works ok in the ipad mini. touch events do not get triggered. instead, the scroll seems to overlap these. EDIT: Solved. please see comment below. While it works ok in ipad pro devices now, I still wish this could work out in chrome's dev console ipad pro view. the behavior is different with click events. instead of mouse down, it starts with mouse move. what gives? this only happens in ipad air and pro view in the device toolbar in dev console.
1
0
525
Jan ’24
Safari Web Extension browser.tabs.captureVisibleTab() is not capturing the image correctly
On Safari Mobile and iOS version 16 or 17, while scrolling the webpage, the function browser.tabs.captureVisibleTab() is not returning the expected screen image. The image is cropped from the top. The probable reason for the same is the collapsible Address Bar. The below attached image is the iPad mini (6th generation ) Simulator OS Version:17.0 simulator The below attached image is created by browser.tabs.captureVisibleTab() I tested it on iPad mini (6th generation ) Simulator OS Version:17.0 and iPad (8th generation) - iPadOS Version 16.2.
1
0
545
Jan ’24
How can I add "WebKit uploads"?
0x60700003ab00 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebKit uploads' for process with PID=56268, error: Error Domain=RBSServiceErrorDomain Code=1 "originator doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=originator doesn't have entitlement com.apple.runningboard.assertions.webkit} Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "originator doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=originator doesn't have entitlement com.apple.runningboard.assertions.webkit}> The above error occurs. What should I do?
0
0
290
Jan ’24
"Google pay button icon" not visible in specific iOS versions
Hi, The below code is used for loading GPay icon dynamically from Google in "WKWebView". The same code works for later versions of IOS like 16.4, but issue happens in 16.1 ,16.2 and 16.3 versions. while loading this code from IOS 16.3 the icon (Gpay icon) is completely black, looks like it's not loaded properly. Please assist us on what can be the issue, and how we can proceed to solve the issue. Not working Working
0
0
466
Jan ’24
navigator.mediaDevices.getUserMedia OverconstrainedError on Safari in IOS17
When javaScript calls to navigator.mediaDevices.getUserMedia using {video: true, audio: true } constraints, throws an error: error: OverconstrainedError constraint: "" message: "Invalid constraint" name: "OverconstrainedError" Same result when constraints has video: true and audio: false You can test it easily opening the webRTC github samples: https://webrtc.github.io/samples/src/content/devices/multi/ https://webrtc.github.io/samples/src/content/getusermedia/gum/ This works fine on IOS16
0
0
511
Jan ’24