Safari is the web browser developed by Apple and built into all Apple devices.

Posts under Safari tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to view the source code of the request message when opening the network menu in Safari browser (view source code)
The Mac Safari version is 17.0. To enable developer options, go to the menu, select "Advanced," and check "Develop." You can inspect web page requests by right-clicking in the web page and selecting "Inspect Element" from the menu. In the "Network" tab, you can capture the page's request messages. However, it seems that Safari does not have a "View Source" option. Is it the case that Safari does not have this option? Not having this option can be quite inconvenient.
0
1
461
Nov ’23
How to view the source code of the request message when opening the network menu in Safari browser (view source code) Safari浏览器的打开network菜单怎么查看请求报文的源代码(view source code)
Mac Safari浏览器版本是:17.0 在菜单-高级选中“开发” 右键单击网页请求以查看“检查元素”菜单,在菜单“网络”中,您可以捕获页面的请求消息。但我发现野生动物园没有观点来源 亲爱的朋友们,Safari浏览器没有这个选项吗? 没有这个选项太麻烦了。 Mac Safari版本是:17.0 在菜单-高级勾选“开发” 在网页请求中鼠标右击可以看到“检查元素”菜单,在菜单“网络”可以捕获页面的请求报文。但是发现safari没有查看来源 各位小伙伴们,safari是没有这个选项吗? 没有这个选项太麻烦了。
0
0
304
Nov ’23
Deep links are not directing users to the intended apps, instead, they are redirecting to the respective apps on app store
Problem : Deep links are not directing users to the intended apps, instead, they are redirecting to the respective apps on app store. When clicking on a deep link in private mode, it consistently displays a prompt to open the application or cancel. If the "Cancel" button is selected on the prompt, it redirects to the app store via a deep link to open the specific application, on next time onwards we are not receiving the prompt to open application, every time it get redirects to the appstore via merchant link automatically. In other case if we click open button on the prompt , it redirects to the application, Subsequently, each time we click the deep link, it repeatedly prompts us to open the app. Why do the "Open" and "Cancel" buttons lead to different outcomes in these scenarios? How can we ensure that the application always opens when clicking on the deep link, if it is in private mode as well?
0
0
635
Nov ’23
ASWebAuthenticationSession initiated session, file:// URL is not loaded and "Confirm the file to load" is presented instead
We are relying on ASWebAuthenticationSession to do web authentication. Since the API doesn't support POST requests directly we have to generate local file in ~/Library/Application Support/<foo.bar>/WebAuth.html containing the POST and use initial URL as file:///Users//Library/Application%20Support//WebAuth.html Problem is that Safari sometimes pops a dialog "Confirm the file to load" and sometimes it doesn't. This doesn't depend on "Full Disk access" TCC. Does anybody know a way to prevent this from happening? MDM option or something? Also styling of the popup is a rather poor UI choice - looks very confusing and like the user may choose another file to load. Chrome f.e. doesn't do such popups. I already have FB13340210 for this.
1
0
749
Jan ’24
Safari responds to a successful "fetch" of a file:// URL with a status of 0
I built a web application that is designed to be run from my application bundle by using webView.loadFileURL(htmlFile, allowingReadAccessTo: projectFolder) on a WKWebView. Inside of the site's folder is a directory of svg images (from the ionicons project). At runtime the code tries to load one of those images using: req = fetch(url).then((rsp) => { if (rsp.ok) { return rsp.text().then((svgContent) => { if (svgContent && sanitize !== false) { svgContent = validateContent(svgContent); } (code from the ionicons project). The rsp.ok check simply examines the response to the fetch request to see if the status code is in the range 200-299. For the "file://" URL, however Safari on both MacOS and iOS returns 0 in the status. In spite of that 0, however the request has succeeded and the browser has the content of the file. If I modify the code to ignore rsp.ok the following call accessing rsp.text() succeeds. I'm not sure what the expectations are for a file:// URL passed through fetch. Is the 0 status code a bug in Webkit or Safari, or is it an expected result for a file:// URL and the code making the fetch request needs work?
0
0
463
Nov ’23
Intermittent "Operation not permitted", "Unable to start the server" error while running 'safaridriver'
I'm encountering an intermittent issue while trying to run safaridriver on macOS Sonoma. Here are the details of the problem: I ran sudo /usr/bin/safaridriver -p0 --enable in the beginning. After that when I run this multiple times /usr/bin/safaridriver -p0, I sometimes receive an "Operation not permitted" error, but not consistently. This issue seems to occur intermittently. I've checked the sudo logs, and I see the following error message: kernel: (Sandbox) Sandbox: com.apple.WebDriver.HTTPService(2049) deny(1) user-preference-write com.apple.WebDriver.HTTPService cfprefsd: (CoreFoundation) [com.apple.defaults:cfprefsd] rejecting write of key(s) MobileDeviceRemoteXPCEnabled in { com.apple.WebDriver.HTTPService, nimish, kCFPreferencesAnyHost, /Users/nimish/Library/Preferences/com.apple.WebDriver.HTTPService.plist, managed: 0 } from process 2049 (com.apple.WebDriver.HTTPService) because setting these preferences requires user-preference-write or file-write-data sandbox access cfprefsd: (CoreFoundation) [com.apple.defaults:cfprefsd] Couldn't open parent path due to [2: No such file or directory kernel: (Sandbox) Sandbox: com.apple.WebDriver.HTTPService(2049) deny(1) network-bind local:*:7055 com.apple.WebDriver.HTTPService: (WebDriver) [com.apple.WebDriver:WebService] Error starting HTTP server listening on localhost:0: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={NSLocalizedDescription=Operation not permitted, NSLocalizedFailureReason=Error in bind() function} com.apple.WebDriver.HTTPService: (WebDriver) [com.apple.WebDriver:XPCService] Client connection invalidated for some reason I am getting this on Mac Os Sonoma Can anybody please help on this?
0
2
677
Nov ’23
iOS Web Push - Passing in Icon Doesn't Work
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.
0
0
538
Nov ’23
Safari runtime.onConnect() not being triggered after DNR redirect
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
0
0
296
Oct ’23
AudioContext.createMediaElementSource broken in iOS 17
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(); });
1
0
760
Oct ’23
Safari extension for macOS: window.focus()
Hello, I have a macOS app that helps navigation through running apps published on the App Store. I would like to create a Safari extension for macOS that would allow the user to open directly one of the last used tabs. Activate a tab is not a problem following the documentation, but my question is: can I allow the opening of a tab that is not in the frontmost window of the current instance of Safari? Security policies about window.focus() function are restrictive also for code executed directly in the "background" script of the extension? P.S. For example, in a Sandbox application you cannot activate directly a window but just a running application as it was left, so I cannot select the interested Safari's window from the macOS app. Thank you!
2
0
565
Oct ’23
Can't scroll past a video with playsinline attribute inside an iframe [Safari iOS 17.0.3]
I'm loading a page inside an iframe. The page contains a video with the playsinline attribute. The video is completely unresponsive to touch events, meaning if it fills up the screen I can't scroll past it, thus breaking the page. Note the video also has autoplay, loop and muted attributes but these did not cause scrolling issues; only playsinline causes the break. Myself and another tester are running Safari on an iPhone 14 with iOS 17.0.3 and it's broken for both of us. Confirmed with 2 additional testers there is no issue with iPhones running iOS 16.6. Test case: https://codepen.io/gem0303/pen/qBgEeaG Repro steps: Load in Safari on an iPhone with iOS 17.0.3 Tap and drag on the white background and dummy scrolling text -- works fine. Tap and drag on the cat video -- scrolling is impossible.
4
1
1.3k
Oct ’23
iOS/Safari 17 does not support COLR/CPAL (v0) format color font
I take these websites to test COLR/CPAL(v0) format color font: https://yoksel.github.io/color-fonts-demo/ https://pixelambacht.nl/chromacheck/ In my iOS 17 device, both websites show unsupported of COLR/CPAL (v0) color font, however, on my other iOS 16 devices, it is supported. COLR/CPAL (v0) color font format is widely supported on mainstream browsers currently, from Blink (Chrome) to WebKit (Safari desktop), why does iOS deprecate it?
1
0
594
Oct ’23
[bug report] window.open with parameters will open in new window instead of new tab by default
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).
2
0
596
Oct ’23