Hello.
We are adding a Safari extension to our app and we have some questions
about communication between the app and its extension.
We have added the nativeMessaging permission to the extension so that it can communicate with the app and communication between both are doing very well.
Our question is about the security of communications between the two.
How can we be sure the native app communicates well with the correct extension?
Can the Safari extension communicate with another native app or can the native app receive messages from another extension?
Explore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.
Post
Replies
Boosts
Views
Activity
On iOS 18 only, I've been getting this error from the didFailToContinueUserActivityWithType in AppDelegate, the activity needed for universal links. It didn't happen on previous versions of it.
Has anyone encountered this ?
Python version 3.9.1
Selenium version 4.25.0
Safari version 18.1.1
I want to operate Safari using Selenium. For this purpose, I would like to set the UserAgent to iOS and change the viewport. What should I do? The following is the content programmed with the Chrome driver. I would like to achieve this using the Safari driver.
import time,os
import chromedriver_binary
from selenium import webdriver
from selenium.webdriver import Safari
from selenium.webdriver.safari.options import Options as SafariOptions
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select
from selenium.webdriver.chrome import service
# selenium 4
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()),options = chrome_options)
# iPhone 13 params
viewport = {
"width": 390,
"height": 844,
"deviceScaleFactor": 3,
"mobile": True
}
#Chrome setting
ua = "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
driver.execute_cdp_cmd("Emulation.setDeviceMetricsOverride", viewport)
# change user agent
driver.execute_cdp_cmd("Emulation.setUserAgentOverride", {"userAgent": ua})
# ページにアクセス
driver.get("https://hogehoge")
タイトルの通り,seleniumからsafariを起動して操作したいのですが,ユーザーエージェントの変更ができずにおります.
ご存知の方は解決方法をご教示いただけますと幸いです.
以下はChromeで操作するためのコードですが,これと同等のことをSafariで行いたいです.
特にUserAgentとviewportの設定についてご教示いただけますと幸いです.
import time,os
import chromedriver_binary
from selenium import webdriver
from selenium.webdriver import Safari
from selenium.webdriver.safari.options import Options as SafariOptions
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select
from selenium.webdriver.chrome import service
# selenium 4
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
#WEBブラウザの起動
chrome_options = Options()
#chrome_options.add_argument("--headless")
#chrome_options.add_argument("--disable-gpu")
#chrome_options.add_argument("--no-sandbox")
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()),options = chrome_options)
viewport = {
"width": 390,
"height": 844,
"deviceScaleFactor": 3,
"mobile": True
}
#Chromeの時の設定
ua = "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
driver.execute_cdp_cmd("Emulation.setDeviceMetricsOverride", viewport)
# ユーザエージェントの変更
driver.execute_cdp_cmd("Emulation.setUserAgentOverride", {"userAgent": ua})
# ページにアクセス
driver.get("https://...") #具体的なURLは省略
When WKWebView loads a site that has username and password on different pages, standard "Passwords" button above keyboard does nothing. Reproducible on both physical device and simulator. At the same time, Safari works fine in this case.
Any chance to fix this behavior in the upcoming iOS updates?
Here's video demonstrating the issue:
and a sample code to reproduce it (nothing specific, just bare WKWebView with default configuration):
class ViewController: UIViewController {
private let webView = WKWebView(frame: .zero)
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(webView)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
webView.frame = view.bounds
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
webView.load(URLRequest(
url: URL(string: "https://accounts.google.com/")!
))
}
}
I have an endpoint that generates a .ics file. From my mobile app, I open the browser (Safari) and retrieve the .ics file. In Safari, the events are displayed as expected, and I can use the "Add All" button to add them to the calendar. After clicking "Add All," I can select the desired calendar, and the events are successfully added (see screenshots 1 and 2 below).
Here’s the initial .ics file response:
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:NAME
BEGIN:VEVENT
DTSTAMP:20250101T195917Z
DTSTART:20250102T131600
DTEND:20250102T142500
SUMMARY:My Event 1
UID:unique-uid1
LAST-MODIFIED:20250101T155715Z
DESCRIPTION:Description
SEQUENCE:1
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20250101T195917Z
DTSTART:20250103T131600
DTEND:20250103T135600
SUMMARY:My Event 2
UID:unique-uid2
LAST-MODIFIED:20250101T155715Z
DESCRIPTION:Description
SEQUENCE:1
END:VEVENT
END:VCALENDAR
Later, I updated the .ics file with new event details:
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:NAME
BEGIN:VEVENT
DTSTAMP:20250102T195917Z
DTSTART:20250104T131600
DTEND:20250104T142500
SUMMARY:My Event 1 Update
UID:unique-uid1
LAST-MODIFIED:20250104T155715Z
DESCRIPTION:Description
SEQUENCE:2
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20250102T195917Z
DTSTART:20250105T131600
DTEND:20250105T142500
SUMMARY:My Event 2 Update
UID:unique-uid2
LAST-MODIFIED:20250102T155715Z
DESCRIPTION:Description
SEQUENCE:2
END:VEVENT
END:VCALENDAR
I updated everything according to the iCalendar documentation:
UID remained unchanged
SEQUENCE has been updated
DTSTAMP has been updated
LAST-MODIFIED has been updated
However it seems like that Safari can't handle updates on events.
In the preview we can see the changes, but when I click on "Add All" button, nothing happens.
The same behavior is working with other calendars like Outlook (web view) or Google Calendar.
My Questions:
Is there a property missing from my .ics file that is necessary for iOS Safari to handle updates?
Is Safari not designed to handle event updates in this way?
Should I consider moving to a subscription-based solution to manage updates more reliably?
Any insights or suggestions would be greatly appreciated!
Hi Apple Team,
Can we use SFSafariViewController to launch a 3rd party passkey authentication experience from a native iOS app?
Regards
On Mac, If the user registers the Password and the Software Authenticator app for a website like PayPal then uses the Safari browser to login the Apple system is creating confusion.
The system prompts to use the authenticator autofill for any grid like SMS OTP or even for the Email OTP. That creates confusion for the user as the SMS OTPs or other OTPs cannot be validated by auto filling the Authenticator TOTP. That fails the validation resulting in bad user experience.
The system should not prompt the Autofill from the Authenticator app unless the grid box shown on the page was for the Authenticator app.
I have a Safari Extension which replaces default new tab and puts a link on a generated new tab.
This link can be either usual URL link, or a URL Scheme, something like
plecoapi://x-callback-url/df?hw=${char}&sec=dict
In iOS 17 and previosly, this link worked flawlessly.
In iOS 18, including 18.2, this X-Callback-URL link works only once, if I kill Safari process, reopen Safari and tap the link.
Each subsequent tap will just reload the page, link won't work anymore until the next Safari reload.
Usual URL links works every time without a problem.
When using WKWebview to load the following url on iOS17.5, The Camara preview page is likely to not display the image, but there is no error report. The video cannot be loaded. There is no problem with iOS17 and iOS18.
I can't find the cause of the error, How to avoid this problem? I hope you can provide some suggestions. I want a way to avoid the error,Thanks
STEPS TO REPRODUCE
Run iOSTest.xcodeproj on iOS17.5
Tap WKWebview(Camara)
Waiting webview load url
tap 手持设备训练 立即开始
download demo
https://github.com/xuty/Report22/raw/refs/heads/main/iOSTest_1_url.zip
Hi,
Our company has an application uses the WKWebview to host a lot of content.
The content is web based and hosts a lot of charts and metrics.
Because of the high content, we've seen the memory of the WebContent hit above 1.25 GB.
When that happens, it'll eventually terminate and we have our recovery code to reload the same page
Seems like the limit is hidden / internal. Some Apple devs also noted something might be hard coded to be limited as well.
Yes, we have our optimizations but we still need to keep our queries, use react, cache, etc... It's just a heavy web application.
Request:
Can you help us raise that limit?
Are there some limitations in Webkit for such a need to terminate?
As some devices have much higher RAM than before, we were hoping to be able to dynamically adjust the limit for the wkwebview before it resets.
We contacted our internal contacts but they said to post here.
I'm using navigator.geolocation.getCurrentPosition to retrieve the users coordinates in a PWA built with Nextjs. getCurrentPosition is called by clicking on a button. If getCurrentPosition is called afterwards, the cached value is returned. On Safari, If I refresh the page, or logout, login and call getCurrentPosition again, the getCurrentPosition error callback is called with an error code 2 - POSITION_UNAVAILABLE. After around five minutes, getCurrentPosition can be called again.
Is there some kind of throttling restriction on Safari navigator.geolocation.getCurrentPosition?
I wrote a code like the example below to execute javascript code that has no return value.
let webView: WKWebView
// after load complete
let result = await webView.evaluateJavascript("someFunction()") // :0: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
but when i use method with completion handler manner, it doesn't be crashed. but Xcode enforces me to use 'await' keyword and warning is bordering me
await webView.evaluateJavaScript("someFunction()", completionHandler: nil) // warning: Consider using asynchronous alternative function
The differnce I found is the different signature. Completion handler version has Optional result type, but async/await version has just Any result type
func evaluateJavaScript(_ javaScriptString: String,
completionHandler: ((Any?, Error?) -> Void)? = nil)
func evaluateJavaScript(_ javaScriptString: String) async throws -> Any
my Xcode version is 13.2.1. Hope to fix it soon.
When configuring a Per-App VPN payload with 250+ Safari domains under a managed app, the VPN does not trigger for the other managed apps(like chrome etc). However, the same VPN successfully starts and works when used with Safari. Reducing the number of Safari domains in the VPN payload resolves the issue, allowing the VPN to trigger for the managed app as expected.
Has anyone else faced this issue, and what's the workaround for it?
Hi there, we have found a problem, after switching audio tracks multi times when play the HLS, there will be a few seconds of no sound playing after audio track switching, Is there a solution to this problem?
Need to connect HTTPS proxy (encrypt all data). If it is possible from iPhone or iPad through phone settings or special app?
Enhancement in managing tabs in Safari
It would really be awesome to bring the fascinating tab management feature of Arc Browser to Safari across iOS, iPadOS and macOS.
Especially below listed features;
Multitask
Create
Organize
Rev Up
Release Notes
For further info , here is the official link of Arc Browser, https://resources.arc.net/hc/en-us/categories/16435255982103-Features.
The web page image is not fully displayed, only part of it is rendered. Switch the app to the background and then to the foreground, and the incomplete image will be rendered correctly again.
We are Java application developers and we have a question regarding camera access via WebRTC on iPadOS. Specifically, on iPadOS 17.1, we are encountering an issue when trying to access the camera via the WKWebView API in the Chrome browser, where an error occurs and the camera capture fails. Our investigation suggests that device access through the navigator.mediaDevices property via the WKWebView API may not work in Chrome. However, it works as expected in the Safari browser, leading us to wonder if this is a Chrome-specific limitation, or if it's due to an iPadOS setting or specification.
At this point, we are unsure if this issue is related to the WKWebView and WebRTC specifications on iPadOS 17.1, or if there are specific limitations in Chrome. We would appreciate any insights or solutions regarding camera access in iPadOS 17.1 with WKWebView and WebRTC, especially in relation to Chrome.
Safari 18.2 on Sequoia 15.2 sends repeated Authorization header when iCloud Relay is enabled and the page is reloaded.
Inside Safari Preferences -> Privacy -> Hide IP address -> from Trackers and Websites (ensure this is enabled)
Visit a website that uses HTTP Authorization and authenticate oneself
Reload website a couple of times and it will result in an HTTP 400 error due to repeat Authorization header sent by Safari