I see the -resumeAllMediaPlayback: says the replacement method is -setAllMediaPlaybackSuspended:completionHandler:
I don't believe suspending and resuming media playback are matching actions, which would mean -resumeAllMediaPlayback: doesn't have a replacement API?
The deprecated -resumeAllMediaPlayback: method doesn't seem to work on Sonoma (pauseAllMediaPlaybackWithCompletionHandler: does work but resume does not).
General
RSS for tagExplore 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
Hello, I try to develop extension for safari. I edited info.plist but I can't see my menu items.
My Info.plist page
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.Safari.web-extension</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
</dict>
<key>SFSafariContextMenu</key>
<array>
<dict>
<key>Text</key>
<string>Search for selected text in MyApplication.</string>
<key>Command</key>
<string>Search</string>
</dict>
<dict>
<key>Text</key>
<string>Add an entry for selected text in MyApplication.</string>
<key>Command</key>
<string>Add</string>
</dict>
</array>
<key>SFSafariWebsiteAccess</key>
<dict>
<key>Level</key>
<string>All</string>
</dict>
</dict>
</plist>
When I add a web site to the dock in Mac OS Sonoma, the developers menu isn't available anymore. We have a web site, that behaves differently whether in docked mode or standard mode and I'd want to check the java script console. What options do I have?
window.getSelection().getRangeAt(0) is giving indexSizeError after selecting text from wkwebview in iOS 17. We are using evaluateJavascript functions for interactions. This was working fine in earlier versions. This problem is seen since the recent iOS 17 upgrade.
WKWebview does not play inline even if wkwebview configuration allowsInlineMediaPlayback is set to true. Also the video has proper tags
I am importing video files from amazon s3 via mac os safari video tag.
It's fine in chrome, but in safari, the video is intermittently not being received.
As you can see in the picture, I am getting the same status code 206, but the red 206 does not contain the address and host.
If anyone knows why, please share the solution.
my web service has video content. the problem is in chrome browser, downloading and playing video is much faster than Webkit browser (Safari and WkWebView).
we are struggling to find the reason why there is huge gap between two browsers.
we've checked browser inspector and there's something look like error in safari inspector that doesn't appear in chrome.
There are two cases in network section.
First red header case that I think something went wrong
Second yellow header csae that I think succeeded to donwload
I am learning to develop webrtc apps and have noticed that starting with safari and safari mobile 17 there is a noticeable zoom distortion that occurs when resizing some webrtc players. This seems to be safari specific and only on version 17. What feature change could cause this?
Here is an example of catalina vs Sonoma. Sorry i dont have access to any other versions in between atm but i have only seen this issue since updating to safari 17
I made a extension using safari extension in Xcode, I tried to find ways to run it and test, was able to test it but was not able to add it on my safari, is there any guidance or solution for it?
It's a regression found in the post in 2021 and it still works in the wrong way.
According to the Apple guide about the "Open pages in tabs instead of windows", when the user sets it to "Automatically", a tab instead of a window is supposed to be opened.
window.open("https://www.apple.com", "_blank", "noopener, noreferrer") is supposed to open a tab because the target we provided is the _blank by default.
However, it will only open the tab when there is no third parameter if we set "Open pages in tabs instead of windows" to "Automatically".
In Firefox and Chrome, a tab by default is opened even with the third parameter provided. And it seemed like the older version of Safari also followed the same behavior.
The Safari version I'm using is 16.6 (18615.3.12.11.2).
I have a global variable in WKUserScript declared as a const in Javascript.
I load this script in a custom WKContentWorld I create with my own name (not the pageWorld or default world).
There some nasty javascript out there on most popular sites. I noticed that unhandled errors on the page can break stop my WKUserScript from working. In one particular case there is this nasty script on page for ads that uses document.write like so:
b.contentWindow.document.write(e),
b.contentWindow.document.close()
And the web inspector shows an error here "Can't create duplicate variable: 'MyGlobalVariableNameInsMyUserScriptHere'"
This script being used on the web page is going to end up getting blocked. But my question is this, isn't using my own content world supposed to protect me against this type of thing? This global javascript variable (an array) is global in my javascript file and holds some data in it but it is not inserted into the DOM. Shouldn't document.write/document.close calls from the page not cause this type of error in my user script?
And if the entire DOM is being rewritten shouldn't a new script (representing my user script) be created from scratch? I think I can avoid the error by changing the variable from const to var (haven't tried yet). But is this how it's supposed to be?
Hi guys I'm developing an extension for Safari using web browser api but Safari does not support management object and getSelft() function. Does anyone know how to check if the extension is installed in development mode?
window.browser.management.getSelf(({ installType }) => {
if(installType === "development") {
// Do some stuff...
}
})
We have a PWA that worked well until iOS 17 (17.0.3). We are using AngularJS.
It seems like the entire app just loses connection to its IndexedDB, and returns to the login screen, whereupon it uses LocalStorage info to successfully log back in again.
After looping in this process a few times (lose connection, login screen, login, rehydrate indexedDB, etc), then LocalStorage eventually gets wiped and the user has to login from scratch.
This is terrible and we have no idea why this is happening. Please fix ASAP!
Safari uses too much memory this bug, Apple's internal developers didn't find it? Even at one point I suspected that he didn't use an Apple device
This bug has been around for years.
I have a website that makes heavy use of the web audio API, the site appears to be broken for all users who have upgraded to iOS 17 (I have verified it no longer works for 17.0.3 and does work for 16.3.1 It also works fine in macOS Safari and all other common desktop browsers that I have tested).
I've created a simple test case page here to illustrate the problem: https://oldtime.radio/audio_test.html - clicking 'Play' downloads and plays audio in older iOS but nothing is played for iOS 17. There are no errors in the console so not much to go on. Is this a known bug. Code reproduced below in case folks don't want to click through to an unknown website:
const btn = document.getElementById('btn');
btn.addEventListener('click', function() {
const audio = new Audio();
audio.crossOrigin = "anonymous";
const AudioContext = window.AudioContext || window.webkitAudioContext,
audioCtx = new AudioContext(),
audioSrc = audioCtx.createMediaElementSource(audio);
audioSrc.connect(audioCtx.destination);
audio.addEventListener('canplaythrough', () => {
audio.play();
});
audio.src = 'https://archive.org/download/Old_Radio_Adverts_01/OldRadio_Adv--1957_Chevrolet.mp3';
audio.load();
});
Hi there!
I'm new to App Development and I'm running into the following error when playing audio on a website loaded through a WKWebView:
0x112000cc0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebKit Media Playback' for process with PID=70.197, error: Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}
Looking through this forum, it seems more people have this issue, yet no one has found a solution (or posted it...). The solutions that I did find (Background Modes capability, webView.configuration.allowsInlineMediaPlayback = true), did nothing.
To make sure the issue had nothing to do with my own code, I created an empty project to reproduce the issue. I'm not sure on the best way to share it, but it's a small file (forgive me, I have no clue what it does, actually chatGPT made it for me. My real application is a WebApp wrapped with Capacitor, so it handles all the Swift stuff)
import SwiftUI
import WebKit
struct WebView: UIViewRepresentable {
let urlString: String
func makeUIView(context: Context) -> WKWebView {
let webView = WKWebView()
webView.configuration.allowsInlineMediaPlayback = true
webView.configuration.allowsAirPlayForMediaPlayback = true
webView.navigationDelegate = context.coordinator
return webView
}
func updateUIView(_ uiView: WKWebView, context: Context) {
if let url = URL(string: urlString) {
let request = URLRequest(url: url)
uiView.load(request)
}
}
func makeCoordinator() -> Coordinator {
Coordinator(self)
}
class Coordinator: NSObject, WKNavigationDelegate {
var parent: WebView
init(_ parent: WebView) {
self.parent = parent
}
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
print("Web page loading failed: \(error.localizedDescription)")
}
}
}
struct WebViewDemo: View {
var body: some View {
NavigationView {
WebView(urlString: "https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_audio_all")
.navigationBarTitle("Web View")
}
}
}
struct WebView_Previews: PreviewProvider {
static var previews: some View {
WebViewDemo()
}
}
Nothing special, right?
When I build the app and navigate to a website that has an tag (https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_audio_all). I still see the error when I play the audio.
It plays nonetheless, but the error is there. I'm not at all interested in actually playing audio in the background/when the app is closed/suspended. I just want the error to go away!
I've tried different iOS versions (14,15,16,17), but the problem persists.
Anyone know what's happening?
Web audio API do not play audio while The device is in silent mode
Hi there, I've run into an issue when using runtime ports to communicate between the popup and the background of an extension. Specifically, onConnect (in the background page) is not being triggered when my extension page is displayed subsequently to a Declarative Net Request Redirection.
Basically, I have DNR that redirect from 'app.mydomain.com' to my extension with a rule such as :
{
priority: 1,
action: {
type: 'redirect',
redirect: {
regexSubstitution: `safari-web-extension://mknlkpphjfngbollbeipeekihpdomdmd/index.html\\1#/\\2`,
},
},
condition: {
regexFilter: `^https?://w*\\.?app\\.mydomain\\.com(\\??[^/#]*)[^#]*#?/?(.*)$`,
resourceTypes: ['main_frame'],
},
},
The redirect works fine, but the onConnect is never triggered in the background page.
If I load the page extension directly (without a redirect being done), it works absolutly fine.
I see no error or warning. Any idea on why this issue occurs and how I could solve it ?
Thanks a lot
Hey everyone,
I did some extensive testing with sending a Web Push notification to my iOS PWA as well as MacOS Safari browser. The push itself works for those platforms but passing in the icon as specified in:
https://developer.mozilla.org/en-US/docs/Web/API/Notification/icon
does not work. It always just defaults to using the icon defined in the PWA's manifest instead. In the support matrix in the link above it says Safari is supposed to support this but it doesn't.
I just wanted to get some second opinions to confirm that it's a known issue that it's broken? I know iOS Web Push was just supported fairly recently so I'm hoping this gets resolved in the future for us to pass in custom icons.
In Safari 16 I could:
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari.SandboxBroker ShowDevelopMenu -bool true
This doesnt seem to work in Safari 17
Anyone aware how to get this functionality back?
Thanks