Running extension either on physical device or simulator.
When trying to get the console log in Safari > Develop > Device >
The main page shows but when launching the popup.js extension it doesn't show in order to see console.
Works fine iOS 17*
Not available iOS 18
FB14109978
Post
Replies
Boosts
Views
Activity
I am developing a web application with PWA and Vue.js (javascript).
I would like to add a Web Push notification function, so I referred to the following site
to execute notification permission and received the response result "granted".
https://developer.mozilla.org/ja/docs/Web/API/Notification/requestPermission_static
I have tried both requestPermission(); and requestPermission(callback).
However, in this state, an error occurred when subscribing to pushManager, and push notification registration could not be executed.
As a workaround, I found that by changing the notification permission setting from the OS Settings > Notification screen to Off and On,
subscribing to pushManager was successful.
Is there anything else I need to implement other than calling requestPermission(); or requestPermission(callback) to make it executable without following the workaround steps?
In addition, this phenomenon was not occurring around the beginning of June 2024, and it was confirmed that the problem occurred as of August 5th.
The confirmed OS and models are as follows.
iOS 17.4 Mobile Safari iPad
iOS 17.3 Mobile Safari
iOS 15.8 Mobile Safari
iOS 17.3 Mobile Safari iPad
iOS 15.8 Mobile Safari iPad
iOS 17.4 Mobile Safari
iOS 16.7 Mobile Safari
We have tested on iPhone 12 Pro and observed that Safari allowed approximately 1.5GB of RAM usage. Page refreshes when trying to allocate more memory. After performing a hard reset and erasing all content, I noticed that Safari allowed approximately 3GB of RAM usage for our webpage. However, after 2-3 days, the maximum allowable RAM usage in Safari decreases to about 1.5GB. Once 1.5GB limit is reached, the system reloads the page.
To further investigate, I performed another hard reset on my device, and once again, Safari allowed around 3GB of RAM usage.
Additionally, we tested this on iPhone 15 Pro and 15 Pro Max, where the RAM limitation in Safari is consistently around 3GB (page is reloading after reaching 3GB).
Could you please clarify why the memory limit fluctuates after hard reset? Is there any specific setting or flag within Safari or iPhone that controls the maximum RAM usage, which could be causing this behavior?
I also posted the issue there: https://bugs.webkit.org/show_bug.cgi?id=277848
I would appreciate any guidance or potential solutions to this issue. If this is a known limitation or issue, understanding the root cause would be extremely helpful.
Thank you for your attention to this matter.
Model Name: iPhone 12 Pro
iOS Version: 17.5.1
Capacity: 128gb
I have some questions about the behavior of encode.
For example, with the following code, when we encode a very large string, the result is an empty array.
So if memory allocation fails due to insufficient system memory or other reasons, and the returned Uint8Array is not successfully created, what will we get? An empty array, an exception, or an OOM crash?
const encoder = new TextEncoder();
const encoded = encoder.encode(largeText);
Hello!
I've been maintaining a Cordova-based calling application for years. Cordova uses a webview to show the user interface and has a bridge for calling native iOS API from JavaScript. The application uses CallKit and VoIP push notifications to handle the calling functionality.
Before the iOS 17.5 update, calling worked relatively stable. However, starting from this version and on, Safari instantly force-closes all open websocket connections when the "Answer" button on the calling UI is hit. So, basically, the call ends right after it answers, because in our case websockets are crucial for the SIP negotiation process.
Firstly, I inspected the Safari console, and there is a new red error saying: WebSocket connection to 'wss://home.thirdlane.com/wss' failed: The operation couldn’t be completed. Software caused connection abort.
Secondly, I checked the Xcode logs, and there are several warnings saying Invalidating grant <invalid NS/CF object> failed every time the call is answered.
And, I'm afraid this is all that I have to cling to.
I managed to mitigate the effect by connecting the websockets only when the call is answered and the application is focused. However, this approach has its own drawbacks and doesn't solve all the problematic cases.
I must mention that the behavior has slightly improved in iOS 17.6 – now the websockets are cut after the "Answer" button hit whereas in 17.5.1 they were cut in ~3 seconds after the VoIP push regardless of whether the answer was made.
This looks like a Safari/WebView bug to me and I would like bring it to the Apple's attention. I've never filed a bug before, so hopefully this is the right place to write.
I can provide more logs or vidoes upon request.
Thank you!
Is there a way to detect if the user has tapped on "Turn Off Content Blockers" option on safari in ios or get a callback from the same?
I am a student at Utah Valley University doing a UX Research project involving spatial web browsing on Safari. I am trying to determine if spatial video and photos would be supported on a safari web page while using the AVP.
I am not a developer, so my knowledge of that front is limited, but I am hoping to get any insight into if that feature would be able to be implemented into a web based experience. If so, what formats would need to be used? Is the MV-HEVC format able to be directly embedded? Or is there another format that needs to be explored?
Any insight is appreciated!
Hi everyone, when My project (Angular 5) running in Safari Browser, we have a download function, it's download the excel file, end with .xlsx, but when running in low version Safari version, it will have a popup, that is not my project did, it blocked be safari itself, you can check the image, my question is how to hide the 'View' button or directly download instead of show the popup?
I'm trying to mimic glossy, semi-transparent blurry backgrounds for my visionOS app inside of WKWebView
It's easy to do for menus like on the screenshot below, using semitransparent background and applying backdrop-effect: blur(20px)
The problem I have is when I make the whole window like this by specifying webView.isOpaque = false and applying to body background-color: transparent. In this case, suddenly, the backdrop-effect: blur stops working for menu. See picture below:
You can clearly see that blur is not working anymore since you can see 3 dots behind the menu. I did not touch any CSS properties for the menu itself, only making the whole window semi-transparent.
Is there any workaround for this problem? For me it's a blocker to make UI to feel native to visionOS.
Hello!
I was wondering if any other developers are experiencing issues with accessing the web extension background script console, sources, etc. on the latest Safari Technology preview or macOS Sequoia betas.
We have an extension which has a persistent background script.
In the latest public release of Safari version 17.5 (19618.2.12.11.6) on macOS Sonoma, everything works as expected. When I enable developer mode in Safari, it shows an additional "Develop" menu and when I select "Web Extension Background Content" in the dropdown, it shows a list of background pages for all installed extensions.
Attaching a screenshot for reference.
However, if I install the latest Safari Technology Preview 197 on macOS Sonoma or just test with the Safari version that comes with MacOS Sequoia beta 1 or beta 2, the "Web Extension Background Content" dropdown menu does not list any background pages.
Attaching a screenshot for reference.
We started discussing the issue with Apple during the latest WWDC.
If anyone at Apple sees this post, I opened FB13834388 to track this issue.
However according to Apple, they cannot reproduce the issue exactly as I see it on all macOS machines around me including clean virtual machines, real hardware (MacBook Pro M1 Max, MacBook Air M2, MacBook Pro Intel based). The "Web Extension Background Content" menu looks as expected on their end which is very confusing to me...
I have a reason to believe that new Safari's developer tools are simply broken in the latest release. I base that statement on the fact that I cannot access it in case of our own Safari extension, Apple's sample "Sea Creator" extension and a few random extensions that I got from the App Store.
I was wondering if anyone else can observe the same behavior or all machines around me are haunted :)
Please share if you have similar issues with Safari Technology Preview 197 or Safari on the latest macOS Sequoia beta.
Any feedback is important to us. If it's a widespread issue, then Apple should prioritize is accordingly. If the issue is somehow specific to our testing, we will fix it on our side. But any test results at this point are bringing more clarity to the situation and are highly appreciated.
We have implemented content blocking using Safari web extension, it blocks the content but after reloading the current page about 3-4 times the blocked content re-appears, how can we fix this issue?
When opening the 3D model in Augmented Reality on Safari, the model initially displays correctly. However, when attempting to move, resize, or rotate it, the device screen freezes along with the Augmented Reality view, and sometimes it crashes the application. This same model does not have any issues when opened in Chrome.
Has anyone experienced something similar, and if so, do you know how to resolve it?
Hi,
I have developed my extension using React and MUI. The extension works with other browsers but it does not work with Safari. Is there any workaround to make it work with Safari or It is not possible to use React build on Safari.
Thank you.
Hello,
I am trying to apply ProxyConfiguration on the WebKit webview.
I referred to the following sources:
https://forums.developer.apple.com/forums/thread/110312 and
https://developer.apple.com/videos/play/wwdc2023/10002/
import WebKit
class WebKitViewModel: ObservableObject {
let webView: WKWebView
@Published var urlString: String = "https://example.com"
init() {
webView = WKWebView(frame: .zero)
}
func loadUrl() {
guard let url = URL(string: urlString) else {
return
}
var request = URLRequest(url: url)
let endpoint = NWEndpoint.hostPort(host: "127.0.0.1", port: 9077)
let proxyConfig = ProxyConfiguration.init(httpCONNECTProxy: endpoint)
let websiteDataStore = WKWebsiteDataStore.default()
websiteDataStore.proxyConfigurations = [proxyConfig]
webView.configuration.websiteDataStore = websiteDataStore
webView.load(request)
}
}
However, this configuration only works for HTTP proxies. When I try to use an HTTPS proxy, it does not work.
When I use NWConnection to connect to the proxy, it works successfully:
import Foundation
import Network
public class HTTPProxy {
private let proxyHost: NWEndpoint.Host
private let proxyPort: NWEndpoint.Port
private var connection: NWConnection?
public init(proxyHost: String, proxyPort: UInt16) {
self.proxyHost = NWEndpoint.Host(proxyHost)
self.proxyPort = NWEndpoint.Port(rawValue: proxyPort)!
}
public func sendHTTPRequest(completion: @escaping (Result<String, Error>) -> Void) {
let tlsOptions = NWProtocolTLS.Options()
let parameters = NWParameters(tls: tlsOptions)
connection = NWConnection(host: proxyHost, port: proxyPort, using: parameters)
connection?.stateUpdateHandler = { [weak self] state in
switch state {
case .ready:
self?.sendConnectRequest(completion: completion)
case .failed(let error):
completion(.failure(error))
default:
break
}
}
connection?.start(queue: .global())
}
private func sendConnectRequest(completion: @escaping (Result<String, Error>) -> Void) {
guard let connection = connection else {
completion(.failure(NSError(domain: "Connection not available", code: -1, userInfo: nil)))
return
}
let username = "xxxx"
let password = "xxxx"
let credentials = "\(username):\(password)"
guard let credentialsData = credentials.data(using: .utf8) else {
print("Error encoding credentials")
fatalError()
}
let base64Credentials = credentialsData.base64EncodedString()
let proxyAuthorization = "Basic \(base64Credentials)"
let connectString = "CONNECT api.ipify.org:80 HTTP/1.1\r\n" +
"Host: api.ipify.org:80\r\n" +
"Proxy-Authorization: \(proxyAuthorization)\r\n" +
"Connection: keep-alive\r\n" +
"\r\n"
if let connectData = connectString.data(using: .utf8) {
connection.send(content: connectData, completion: .contentProcessed { error in
if let error = error {
completion(.failure(error))
} else {
self.receiveConnectResponse(completion: completion)
}
})
}
}
private func receiveConnectResponse(completion: @escaping (Result<String, Error>) -> Void) {
connection?.receive(minimumIncompleteLength: 1, maximumLength: 65536) { data, context, isComplete, error in
if let data = data, let responseString = String(data: data, encoding: .utf8) {
if responseString.contains("200 OK") {
self.sendRequest(completion: completion)
} else {
completion(.failure(NSError(domain: "Failed to establish connection", code: -1, userInfo: nil)))
}
} else if let error = error {
completion(.failure(error))
}
}
}
private func sendRequest(completion: @escaping (Result<String, Error>) -> Void) {
guard let connection = connection else {
completion(.failure(NSError(domain: "Connection not available", code: -1, userInfo: nil)))
return
}
let requestString = "GET /?format=json HTTP/1.1\r\n" +
"Host: api.ipify.org\r\n" +
// "Proxy-Authorization: Basic xxxxxxxx\r\n" +
"Connection: keep-alive\r\n" +
"\r\n"
print("Sending HTTP request:\n\(requestString)")
if let requestData = requestString.data(using: .utf8) {
connection.send(content: requestData, completion: .contentProcessed { error in
if let error = error {
completion(.failure(error))
} else {
self.receiveResponse(completion: completion)
}
})
}
}
private func receiveResponse(completion: @escaping (Result<String, Error>) -> Void) {
connection?.receive(minimumIncompleteLength: 1, maximumLength: 65536) { data, context, isComplete, error in
if let data = data, !data.isEmpty {
print ("Data: \(data)")
if let responseString = String(data: data, encoding: .utf8) {
print("Received response:\n\(responseString)")
completion(.success(responseString))
} else {
completion(.failure(NSError(domain: "Invalid response data", code: -1, userInfo: nil)))
}
} else if let error = error {
completion(.failure(error))
}
if isComplete {
self.connection?.cancel()
self.connection = nil
} else {
self.receiveResponse(completion: completion)
}
}
}
}
This approach works for connecting to the proxy, but it does not help with configuring the proxy for WebKit.
Could someone please assist me in configuring a proxy for WebKit WebView to work with HTTPS proxies?
Thank you!
In Safari, when there are two password fields side-by-side, they are actually asking for different passwords. However, the browser's autofill might automatically fill the second field with the same password as the first, assuming it's a confirmation.
The process to reproduce:
Create a new extension with Xcode 16 beta.
Run it on the simulator or any iOS device with iOS 18 beta installed.
Open Safari on your Mac, then open Develop -> Device you use.
Unable to access these menus for iOS 18:
1. Extension - Extension Background Content
2. Extension - Extension Pop-up Page - popup.html
However, for iOS 17.4, I can see these options in Develop -> Device iOS(17.4).
I have another extension on the App Store that is not working on the iOS 18 beta, but I am unable to debug it because of this issue.
Can we get the list or count of the URLs blocked using the Safari web extension content blocking on the iOS app?
We are trying to implement ad blockers using the Safari web extension, and we are implementing this using the declarativeNetRequest, with a manifest version 2. We have added a json file which contains a rule set for over 22000 URLs, does content blocker have a limit to the number of rules we set in json?
Although it does work fine, sometimes we see the behaviour different on simulators and on clearing the cache it works fine is this expected?
I have integrated the Safari Content Blocking extension, and it works perfectly on the first run, effectively blocking content on Safari. However, after re-installing the app, I occasionally encounter the following error, despite the content blocker functioning as expected:
"Failed to reload content blocker Error Domain=SFErrorDomain Code=3 "(null)""
What could be causing this intermittent error?
I have a link that is embedded in the app using WKWebView. This link is working fine in the Macbook Safari browser, But it's not open in iPhone Safari and wkWebView in the app.