I have a small example project that ran on both the simulator and a connected iPhone but now it and all other projects are failing with the same error. I am using Xcode 16.0 on MacOS Sonoma 14.6.1., iPhone 11 with iOS 18. Thank you in advance.
The error is:
Failed to resolve host network app id to config: bundleID: com.apple.WebKit.Networking instance ID: Optional([_EXExtensionInstanceIdentifier: 1163B5D2-09D3-4704-9564-61099502138B])
WebContent process (0x114018680) took 1.375772 seconds to launch
GPU process (0x1140a0630) took 1.228457 seconds to launch
Networking process (0x114034d00) took 1.426249 seconds to launch
0x105820a20 - [pageProxyID=7, webPageID=8, PID=34786] WebPageProxy::didFailProvisionalLoadForFrame: frameID=1, isMainFrame=1, domain=NSURLErrorDomain, code=-1200, isMainFrame=1, willInternallyHandleFailure=0
Message from debugger: killed
Below is the code from one of the examples:
import UIKit
import WebKit
class ViewController: UIViewController {
let webView: WKWebView = {
let prefs = WKWebpagePreferences()
prefs.allowsContentJavaScript = true
let configuration = WKWebViewConfiguration()
configuration.defaultWebpagePreferences = prefs
let webView = WKWebView(frame: .zero, configuration: configuration)
return webView
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(webView)
guard let url = URL(string: "https://google.com") else {
return
}
webView.load(URLRequest(url: url))
//evaluate JavaScript
DispatchQueue.main.asyncAfter(deadline: .now()+5){
self.webView.evaluateJavaScript("document.body.innerHTML") { result, error in
guard let html = result as? String, error == nil else {
return
}
print(html)
}
}
}
override func viewDidLayoutSubviews(){
super.viewDidLayoutSubviews()
webView.frame = view.bounds
}
}
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
When I create a polyline and add it to the map, it will disappear if the map is moved. If I add a polygon or annotation, it remains on the map if the map is moved:
const polyline = new mapkit.PolylineOverlay(path, {
style: new mapkit.Style({
lineWidth: 5,
strokeColor: '#007AFF',
lineJoin: 'round',
lineCap: 'round'
})
})
map.addOverlay(polyline)
// disappears if the map moves or zoom changes
const polygon = new mapkit.PolygonOverlay(shapes, {
style: new mapkit.Style({
fillRule: 'evenodd'
}),
enabled: false
})
map.addOverlay(polygon)
// remains on map when map moves or zoom changes
Why is it inconsistent? How can I make the polyline stay until I explicitly remove it?
I have a product developed base on the WKWebview.
I use Azure as IDP configured for login in. Azure have “keep me sign in” to allow user no need to enter credential again after reopen the app.
Every thing works fine in IOS 17. 16. But keep me sign in function not works anymore after upgrade device to IOS 18. User need to enter credential every time after reopen the app.
Is there any thing change in WKWebview in IOS 18?
When I run this program on iphone ( ios 18.0 with Xcode 16.0 (16A242d) ) I get these warnings from iphone ( not from the preview running ) :
Could not create a sandbox extension for '/var/containers/Bundle/Application/7BAE-82-4A3-98D-75A49B/xxxx.app'
Updated list with error: DownloadFailed
Updated list with error: DownloadFailed
Updated list with error: DownloadFailed
Updated list with error: DownloadFailed
Updated list with error: DownloadFailed
The programe is simple :
import SwiftUI
import WebKit
struct ContentView: View {
let htmlContent = """
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a simple webpage displayed in a WebView.</p>
</body>
</html>
"""
var body: some View {
WebView(htmlContent: htmlContent)
.edgesIgnoringSafeArea(.all)
}
}
struct WebView: UIViewRepresentable {
let htmlContent: String
func makeUIView(context: Context) -> WKWebView {
let webView = WKWebView()
webView.loadHTMLString(htmlContent, baseURL: nil)
return webView
}
func updateUIView(_ uiView: WKWebView, context: Context) {
// No need to update the view since the content is static
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
any reason for this ?
otherwise the program is running correctly, but is this a bug or a programming problem?
So recently Intune add support for controlling safari web extension enablement using the new ddm configuration added in Macos 15, but unfortunately I can't make it work no matter what I try.
On the destination machine I see the that a user declaration for safari extension has been created, but there is not details on which extension they applied and it seems faulty (See attachment)
I have 2 questions:
Has anyone managed to make it work?
Is there a way to test this declaration like I can do with Mobile config by manually load it to the machine?
Thank you.
Here are the crash logs from Firebase Crashlytics
Crashed: com.apple.IPC.ReceiveQueue
0 libsystem_platform.dylib 0x70c8 _os_unfair_lock_recursive_abort + 36
1 libsystem_platform.dylib 0x42d8 _os_unfair_lock_lock_slow + 308
2 WebKit 0xe2a5f0 <redacted> + 44
3 WebKit 0xe2a264 <redacted> + 320
4 WebKit 0xe29b24 <redacted> + 304
5 WebKit 0x1d8fc <redacted> + 740
6 libdispatch.dylib 0x40d0 _dispatch_client_callout + 20
7 libdispatch.dylib 0x7580 _dispatch_continuation_pop + 596
8 libdispatch.dylib 0x1b53c _dispatch_source_latch_and_call + 420
9 libdispatch.dylib 0x1a104 _dispatch_source_invoke + 836
10 libdispatch.dylib 0xb560 _dispatch_lane_serial_drain + 368
11 libdispatch.dylib 0xc1e0 _dispatch_lane_invoke + 380
12 libdispatch.dylib 0x17258 _dispatch_root_queue_drain_deferred_wlh + 288
13 libdispatch.dylib 0x16aa4 _dispatch_workloop_worker_thread + 540
14 libsystem_pthread.dylib 0x4c7c _pthread_wqthread + 288
15 libsystem_pthread.dylib 0x1488 start_wqthread + 8
We are encountering an issue where the Safari extension we are developing stops working while in use on relatively new iOS versions (confirmed on 17.5.1, 17.6.1, and 18). Upon checking the Safari console, the content script is displayed in the extension script, so the background script or Service Worker must be stopping. The time until it stops is about 1 minute on 17.5.1 and about one day on 17.6.1 or 18.
When it stops, we would like to find a way to restart the Service Worker from the extension side, but we have not found a method to do so yet. To restart the extension, the user needs to turn off the corresponding extension in the iPhone settings and then turn it back on.
As mentioned in the following thread, it is written that the above bug was fixed in 17.6, but we recognize that it has not been fixed. https://forums.developer.apple.com/forums/thread/758346
On 17.5.1, adding the following process to the background script prevents it from stopping for about the same time as on 17.6 and above.
// Will be passed into runtime.onConnect for processes that are listening for the connection event
const INTERNAL_STAYALIVE_PORT = "port.connect";
// Try wake up every 9S
const INTERVAL_WAKE_UP = 9000;
// Alive port
var alivePort = null;
// Call the function at SW(service worker) start
StayAlive();
async function StayAlive() {
var wakeup = setInterval(() => {
if (alivePort == null) {
alivePort = browser.runtime.connect({ name: INTERNAL_STAYALIVE_PORT });
alivePort.onDisconnect.addListener((p) => {
alivePort = null;
});
}
if (alivePort) {
alivePort.postMessage({ content: "ping" });
}
}, INTERVAL_WAKE_UP);
}
Additionally, we considered methods to revive the Service Worker when it stops, which are listed below. None of the methods listed below resolved the issue.
①
Implemented a process to create a connection again if the return value of sendMessage is null. The determination of whether the Service Worker has stopped is made by sending a message from the content script to the background script and checking whether the message return value is null as follows.
sendMessageToBackground.js
let infoFromBackground = await browser.runtime.sendMessage(sendParam);
if (!infoFromBackground) {
// If infoFromBackground is null, Service Worker should have stopped.
browser.runtime.connect({name: 'reconnect'}); // ← reconnection process
// Sending message again
infoFromBackground = await browser.runtime.sendMessage(sendParam);
}
return infoFromBackground.message;
Background script
browser.runtime.onConnect.addListener((port) => {
if (port.name !== 'reconnect') return;
port.onMessage.addListener(async (request, sender, sendResponse) => {
sendResponse({
response: "response form background",
message: "reconnect.",
});
});
②
Verified whether the service worker could be restarted by regenerating Background.js and content.js.
sendMessageToBackground.js
export async function sendMessageToBackground(sendParam) {
let infoFromBackground = await browser.runtime.sendMessage(sendParam);
if (!infoFromBackground) {
executeContentScript(); // ← executeScript
infoFromBackground = await browser.runtime.sendMessage(sendParam);
}
return infoFromBackground.message;
}
async function executeContentScript() {
browser.webNavigation.onDOMContentLoaded.addListener((details) => {
browser.scripting.executeScript({
target: { tabId: details.tabId },
files: ["./content.js"]
});
});
}
However, browser.webNavigation.onDOMContentLoaded.addListener was not executed due to the following error.
@webkit-masked-url://hidden/:2:58295
@webkit-masked-url://hidden/:2:58539
@webkit-masked-url://hidden/:2:58539
③
Verify that ServiceWorker restarts by updating ContentScripts
async function updateContentScripts() {
try {
const scripts = await browser.scripting.getRegisteredContentScripts();
const scriptIds = scripts.map(script => script.id);
await browser.scripting.updateContentScripts(scriptIds);//update content
} catch (e) {
await errorLogger(e.stack);
}
}
However, scripting.getRegisteredContentScripts was not executed due to the same error as in 2.
@webkit-masked-url://hidden/:2:58359
@webkit-masked-url://hidden/:2:58456
@webkit-masked-url://hidden/:2:58456
@webkit-masked-url://hidden/:2:58549
@webkit-masked-url://hidden/:2:58549
These are the methods we have considered. If anyone knows a solution, please let us know.
declarativeNetRequest.getMatchedRules() gives us the below error:
Error retrieving tabs or matched rules: – Error: Invalid call to declarativeNetRequest.getMatchedRules(). The 'activeTab' permission has not been granted by the user for the tab.
We have added the "activeTab" permissions in the manifest (version 2). And in the device Safari extension settings we see that user has given permission as "allow".
We're developing a service that requires webtransport support in the browser. Currently, the only browser that doesn't provide support is the IOS version of Safari.
Our current way forward for client use is to flag iphone and ipad as non compliant and recommend either desktop use or android.
Is there any ballpark date as to when WebTransport will be included in IOS Safari (- webkit supports webtransport)?
After updating Xcode to the latest version we observed that SFSafariViewController is not loading web pages on Xcode 16 Simulator with iOS 18, whenever it is presented the View Controller is empty (does not load any content) and the app freezes, but other screens that use WKWebView are working normally.
Also, during tests on physical devices with iOS 18 it seems to work just fine, so it might be just a IDE version problem.
Is anyone experiencing the same issue?
If so, did anyone find a solution for it?
Hi, there.
I am trying to use ServiceWorker on iPad to retry a request that has a communication error. However, I am having trouble with the process being terminated after 70 seconds.
Occurs at least on iPadOS 17.6.1 and 16.3.
The following is the service worker code to reproduce the problem:
self.addEventListener('fetch', (event) => {
if (event.request.url.includes('test.html')) {
event.respondWith(longRunFetch());
}
});
async function longRunFetch(request) {
await new Promise(resolve => setTimeout(resolve, 75000));
return new Response('Fetch completed');
}
When this code is executed on an iPad and a request is made to test.html, the service worker stops after about 70 seconds. When it stops, it falls back to the network request and the contents of test.html are displayed. The service worker thread appears to be killed and is unavailable until the browser is restarted.
If timeout is set to 65000, 'Fetch completed' is displayed as expected.
Why is the process terminated in 70 seconds?
Is there any way to continue processing beyond 70 seconds?
I'm using sendMessage to send a message to the content script of a specific tab, identified by its tabId. However, in iOS 18 Safari, the message is being sent to all tabs instead of just the targeted one.
browser.tabs.sendMessage(tabId, {'message'});
Hi everyone,
I’m working on an app that uses WKWebView. Due to security concerns, our customers want the app to disable copy-paste functionality and similar options (such as Lookup and Share, allowing users to extract text from the app or save it as a file.
I was able to disable copy-paste and remove UIMenu options like Lookup and Share.
Everything worked fine until the iOS 18.1 beta, which introduced a new menu called Writing Tools (Apple Intelligence) that has its own copy and share buttons
I've tried several ways to remove it
Remove all UIMenu items using canPerformAction, and it works for all menus but Writing Tools, which still remains
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
return false
}
Remove it from UIMenuBuilder
override func buildMenu(with builder: UIMenuBuilder) {
builder.remove(menu: .lookup)
builder.remove(menu: .share)
}
But unfortunately, UIMenuBuilder does not have an identifier for Writing Tools, and it seems like there are no API changes from Xcode 15 to Xcode 16 (https://developer.apple.com/documentation/uikit/uimenu/identifier)
It seems like the only way to disable it through MDM configuration (key: allowWritingTools), but we don't use MDM
https://developer.apple.com/documentation/devicemanagement/restrictions
Environment
iOS Version: iOS 18.1 beta4
Device: iPhone 15 Pro
App platform: iOS
Xcode version: 16.0
MacOS: 15.0
Thank you
I am experiencing an issue with my app, which includes a WKWebView used for displaying and playing WebRTC content (audio and video). Everything works fine on macOS, but on iOS 18, while the video is displayed correctly, there is no sound.
I am wondering if this could be related to privacy permissions on iOS. Could you please clarify if there are any specific privacy permissions I need to address?
I would like to confirm:
AVAudioSession.sharedInstance().setCategory requires any special configuration for WebRTC audio. Are there any particular settings needed for this? My setting codes are below:
try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default, policy: .longFormAudio)
Do the JavaScript codes in the HTML file require any special handling to ensure WebRTC audio works properly on iOS?
const audioRender = document.createElement('audio');
audioRender.id = 'xxxid';
audioRender.srcObject = streamSource;
audioRender.autoplay = true;
audioHolder.appendChild(audioRender);
Does WKWebViewConfiguration need any specific parameter adjustments to ensure audio playback in WebRTC works as expected?
let webViewConfiguration = WKWebViewConfiguration()
let contentController = WKUserContentController()
contentController.add(self, name: "***")
webViewConfiguration.userContentController = contentController
webViewConfiguration.allowsInlineMediaPlayback = true
Web-apps which call speechSynthesis.getVoices() used to get a couple of good quality TTS voices which are still available in the iOS 18 simulator: com.apple.voice.compact.es-ES.Monica and com.apple.voice.compact.es-MX.Paulina
Unfortunately on a real iPhone running iOS 18, these voices are not available, which is a regression since iOS 17 had them. The only Spanish voices start with the prefix com.apple.eloquence.es and are of worse quality.
Hi, I am having issue with WebAssembly not able to load wasm file on Safari web extension.
It is showing CompileError: Refused to create a WebAssembly object because 'unsafe-eval' or 'wasm-unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval'".
It was working fine 2 month ago, my original CPS is "script-src 'self' 'unsafe-eval'". But now it is not accepting 'unsafe-eval', I also tried 'wasm-unsafe-eval' did not work.
Is there any changes on Safari browser regarding the CSP for WebAssenbly? Please let me know what CPS value will work.
Here is the example code on how I load the WebAssembly wasm file.
fetch('test_wasm_lib.wasm')
.then(response => {
if (!response.ok) throw new Error('Network response was not ok');
return response.arrayBuffer();
})
.then(bytes => WebAssembly.instantiate(bytes))
.then(results => {
// Use your WebAssembly instance here
console.log('load wasm success')
})
.catch(error => {
console.error('Error loading WASM:', error);
});
Hello,
I am facing a strange issue on iOS 18. After upgrading to iOS 18, I noticed the following problem:
When connected to mobile data (with Wi-Fi turned off) and trying to upload a file larger than 1MB, the connection times out. However, if I repeat the same action using Wi-Fi, everything works fine.
I have tested this issue in various ways, but nothing seems to resolve it. It appears that iOS 18 might have introduced a bug.
You can replicate the issue using this site: https://video.online-convert.com/convert-to-mp4 (Note: this is not my page, but I found the same issue here).
From the server access logs, I see successful pre-flight requests, but the main POST request never follows, which suggests that the client is not sending the request.
Hi, there is a problem on my client website and many website i visited last 2 weeks.
Site works and few second later i got
A problem repeatedly occured on ...
this only happen on iOS and Safari. I don't know where to post that but the only info i found they said flush cache but in reality this is a Apple error
Look on Oakley and try navigate or refresh page its not happening on every action :\ https://www.oakley.com/en-ca/category/snow
Cookies are not applied in fetch request in the extension background page when executed in a Profile
When I open a URL in a tab in a Profile, I see that cookies are applied accordingly. When I do a fetch request with {"credentials":"include"} in the extension background page in a Profile, the cookies are not sent in the request. This, however, works when doing it in the normal "Personal Profile".
Dear Apple Support Team,
I hope this message finds you well. I am writing to express my frustration and seek assistance regarding an issue I am experiencing with my new iPhone 15 after updating to iOS 18.0.
Since the update, my device has become unresponsive and is stuck on the lock screen. I have attempted multiple troubleshooting steps, including resetting and restoring my iPhone, but unfortunately, none of these actions have resolved the problem.
Here are the specific steps I have taken:
I performed a force restart of the device by following the appropriate button sequence.
I attempted to restore the device using iTunes/Finder by putting it into recovery mode, but the issue persists.
I have ensured that my device is charged and that I am using the original charging cable.
Despite my efforts, my iPhone remains unresponsive, and I am unable to access any of its features. This situation is quite concerning, especially considering that I rely on my device for daily communication and tasks.
I would greatly appreciate any guidance or solutions you could provide to help resolve this issue. If there are any further steps I should take or if I need to bring my device in for service, please let me know.
Thank you for your attention to this matter. I look forward to your prompt response.