Questions tagged [safari]

Safari is Apple's web browser, the default browser on macOS and iOS.

Safari is the web browser bundled with iOS and macOS, operating systems from Apple. Previously, Windows was a supported platform but was discontinued after version 5.

Safari uses the WebKit rendering engine and the JavaScript Core JavaScript engine.

For Safari for iOS devices, there is the tag.

Documentation

17726 questions
73
votes
13 answers

iOS 7 iPad Safari Landscape innerHeight/outerHeight layout issue

We're seeing issues with a web app that has a height of 100% on Safari in iOS 7. It appears that the window.innerHeight (672px) doesn't match window.outerHeight (692px), but only in landscape mode. What ends up happening is that in an app with 100%…
hisnameisjimmy
  • 1,508
  • 2
  • 17
  • 24
72
votes
5 answers

iPhone Browser simulator for Windows?

Note: This is a question about simulating the Browser on the iPhone, not simulating the whole device. I know that iPhone-device simulation is not possible on Windows, as discussed at length here. I have a web site that looks really weird when viewed…
codeulike
  • 22,514
  • 29
  • 120
  • 167
72
votes
10 answers

Why can't JavaScript .play() audio files on iPhone safari?

I've got a JavaScript web app working that plays some audio periodically like this: var SOUND_SUCCESS = new Audio('success.mp3'); SOUND_SUCCESS.play(); This works great on desktop browsers (tested in Edge and Chrome), but it doesn't play on Safari…
Leon Overweel
  • 1,488
  • 4
  • 17
  • 27
71
votes
3 answers

How to detect device name in Safari on iOS 13 while it doesn't show the correct user agent?

After Apple's iOS 13 release, I realized window.navigator.userAgent in Safari on iPad iOS 13 is same as on MacOS. Something like this: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0…
Saeid Amanzadeh
  • 713
  • 1
  • 5
  • 7
70
votes
5 answers

How to set a breakpoint on a minified JS function in Chrome or Safari?

I'd like to set a breakpoint in a "Cart.add" function in the Chrome or Safari JavaScript debuggers. Problem is, this function is defined in a large minified JS file, and doesn't exist on a line by itself. Some documentation says that the…
Blake Scholl
  • 921
  • 1
  • 7
  • 10
68
votes
18 answers

Setting cross-domain cookies in Safari

I have to call domain A.com (which sets the cookies with http) from domain B.com. All I do on domain B.com is (javascript): var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src =…
Luca Matteis
  • 29,161
  • 19
  • 114
  • 169
68
votes
2 answers

How to force Mac OS to open "Search with Google" in Chrome

While using Mac OS, its very useful to use "Search with Google" tool in context menu to directly search selected text from error windows or other content: But problem is, that it always open Safari by default. I have Google Chrome as default…
zur4ik
  • 6,072
  • 9
  • 52
  • 78
67
votes
7 answers

iOS iPad Fixed position breaks when keyboard is opened

Fixed position breaks on header when I click on the "Search Form" text box field. It simply detaches from the top of the page (as it's fixed up there) and starts floating middle of the page when the virtual keyboard opens up. Normal: Broken:
coldblooded01
  • 712
  • 1
  • 6
  • 9
66
votes
20 answers

Disabling Safari autofill on usernames and passwords

You might already know, that Safari has a nasty autofill bug where it fills email, username and password fields no matter if you set autocomplete="off" or not. Here's a basic form:

Jari
  • 749
  • 1
  • 6
  • 9
65
votes
15 answers

Debug message "Resource interpreted as other but transferred with MIME type application/javascript"

OK, I understand what the messages means, but I'm really not sure what's causing it. I'm using Safari and the Web Inspector on Mac OS X, by the way. I've got the following in my document head: