Safari user agent mac os

User Agent in Safari on iPadOS

During authentication flow in Safari, we have a case when in order to satisfy a condition policy, user needs to install the app on his device. Depending on the OS, we ask him to install different applications. Since on iPadOS User Agent in Safari is same as on MacOS Catalina, what is recommened way to distinguish OS on server side?

Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15

Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Answers

I have a similar situation as antrix1989 where our webclient determines if a user is browsing via an iPad with JavaScript and alters/restricts the content. We can then market our clients to a subscription on/with our native iOS app. Would be super helpful if the User Agent stated it was iPad OS instead of Mac OS X:

so a regex match could be done to fairly certain determine a user was on iPad.

Hopefully this will change closer to or after the release?

Any update on this? Will the issue be solved before ios13 is released? I’m facing the same issue on iPads.

In our case we use the user agent to detect if the browser belongs to a mobile device.

This is important because on mobile devices we set our web application to listen the touch events such touchstart, touchend, etc, to drag some elements. But currently we cannot subscribe to those events since we cannot detect it is a mobile device.

Somebody in another forum suggested me to verify if Safari browser is not set to show the desktop version of the web site. I’ll check that today. But I think this is still an issue because even if user agent is retrieved as the desktop device, mouse events are not being emulated by safari.

Источник

Отладка в мобильном Safari

Есть несколько способов потестировать и подебажить сайт или веб-приложение в мобильном Safari:

  • с помощью user agent в десктопном браузере;
  • с помощью физического устройства – реального iPhone или iPad подключенному к Mac через USB-порт;
  • с помощью виртуального устройства – симулятора iOS в Xcode.

Во всех трех случаях понадобится Mac и десктопный Safari со включённым Web Inspector.

Как включить Web Inspector в Safari

Если в воем Safari на Mac вы не можете найти веб-инспектор, значит его нужно включить. Для этого, из главного меню перейдите SafariPreferencesAdvanced (SafariНастройкиДополнения), отметьте пункт Show Develop menu in menu bar (Показывать меню Разработка в строке меню). В меню появится пункт Develop (Разработка), а в контекстном меню Safari, пункт для вызова веб-инспектора Inspect Element (Исследовать Элемент).

Горячие клавиши для вызова веб-инспектора: Opt + Cmd + I

Используя команды меню Develop, можно просматривать код веб-страниц, менять юзер агент, включать и отключать различные элементы страниц, чистить кэш и другое.

Отладка мобильного Safari с помощью User Agent и Web Inspector

Самый простой способ заглянуть «под капот» мобильного сайта – использовать веб-инспектор десктопного Safari, эмулируя необходимое iOS устройство. Способ не заменит честного тестирования на физических устройствах, так как не учитывает всех их особенностей, однако будет полезен при верстке или быстрой диагностики проблемы, когда реального устройства нет под рукой.

Чтобы эмулировать работу сайта на мобильном Safari, перейдите на сайт, включите режим адаптивного дизайна DevelopEnter Responsive Design Mode (РазработкаВойти в режим адаптивного дизайна), затем выберите устройство и при необходимости юзер агент (версию мобильного браузера).

Для отладки используйте веб-инспектор. Доступны те же инструменты инспектора, что и для десктопной версии сайтов, включая консоль.

Читайте также:  Marks windows and doors

Отладка мобильного Safari с помощью iPhone или iPad

Часто ошибка может воспроизводится на определенной версии браузера, операционной системе или устройстве. Поэтому способ тестирования и отладки на реальных iPhone или iPad самый «честный» из перечисленных. Однако он же самый неудобный и затратный: множество устройств надо иметь при себе, заряжать, поддерживать.

Чтобы провести отладку, подключите кабелем iPhone или iPad к Mac. Если появится сообщение Доверять этому компьютеру?, выберите Да, тем самым разрешив доступ к устройству.

В настройках мобильного Safari: SettingsSafariAdvanced (НастройкиSafariДополнения) включите Web Inspector (Веб-инспектор).

На устройстве в мобильном Safari перейдите на сайт, отладку которого хотите провести. Затем откройте Safari на Mac. Если устройство корректно подключилось, то в меню Develop (Разработка) появится пункт с названием вашего устройства, а в подменю будет пункт с названием открытого на устройстве сайта. Клик по нему запустит веб-инспектор и вы сможете провести отладку.

Отладка мобильного Safari с помощью симулятора iOS в Xcode

Удобный способ для разработки и тестирования адаптивных сайтов и веб-приложений на устройствах максимально приближенных к реальным.

Симулятор все же не реальное устройство, за то не требуется держать «зоопарк» различных девайсов, а переключение между ними происходит в несколько кликов мыши.

Simulator – это приложение, которое поставляется в комплекте с Xcode. Скачайте его из магазина приложений .

Откройте Xcode. В меню выберите XcodeOpen Developer ToolSimulator (XcodeОткрыть инструменты разработчикаСимулятор). Когда симулятор запустится, рекомендую сразу закрепить его в Dock, чтобы каждый раз не запускать Xcode.

Выберите устройство для эмуляции в меню HardwareDevice.

В устройстве на эмуляторе откройте Safari и перейдите на сайт. Затем откройте Safari на Mac. В меню Develop (Разработка) появится пункт с Simulator – Модель выбранного устройства, а в подменю будет пункт с названием открытого на устройстве сайта. Клик по нему запустит веб-инспектор и можно будет провести отладку.

Полезные ссылки

На этом всё. Но вы можете поддержать проект. Даже небольшая сумма поможет нам писать больше полезных статей.

Если статья помогла или понравилась, пожалуйста поделитесь ей в соцсетях.

Источник

User Agent in Safari on iPadOS

During authentication flow in Safari, we have a case when in order to satisfy a condition policy, user needs to install the app on his device. Depending on the OS, we ask him to install different applications. Since on iPadOS User Agent in Safari is same as on MacOS Catalina, what is recommened way to distinguish OS on server side?

Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15

Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Answers

I’m starting to wonder if ‘iPadOS’ is code for Catalyst.

After all, we’re told we can build one app for mac and ipad. where is the bifurcation to help websites deliver their mobile-centric version?

Now that ios13 is out of Beta and deployed does anybody else still see the UA issue for Safari

Is there any fix on the horizon — We can’t ask the entire Safari iPad using internet to know about and toggle this Dev tools fix

I can’t believe they set this option to default on iPads, from minimal testing it’s the Safari and Firefox browsers on iPads that default to «Desktop View» (Chrome still defaults to mobile website on ipads) and no one is offering a way for developers to get around this.

I collapse my menus on mobile devices and remove/add certain elements that are different from my desktop site and this completely destroys all of that coding.

This is still an issue.
Yes, the Desktop settings workaround does help get a sensible userAgent, but nobody on a large iPad is ever going to set that.
The main issue I have is that I’m developing an HTML5 Audio player where we want to hide our volume control interface when the device is an iPhone or iPad, since there is no way to control HTML5 Audio volume property via Javascript on these devices.
Does anyone have a sane solution to this?

Читайте также:  Node js linux x32

OK I have a solution.

Simply create an HTML5 Audio object and attempt to set the .volume property.

Mobile Safari can’t do this.

Agreed. This is a devasting user experience for the iPad. And you want people to choose an iPad over a Mac and you make completely ****** moves like this? For example, iPadOS does not auto-uncompress .zip files like a Mac. Users come on the support saying how nothing works, because when they tap the download it’s broken. Even sophisticated users have to poke around to find «Uncompress» buried at the bottom of the the long-touch menu. If you didn’t LIE to my web server, I could offer the uncompressed link, and everything would be fine.

Do not LIE about your user-agent, certainly CPU architecture and operating system. That is the kind of schmuck moves the old Microsoft would make. Perhaps they hired the MSIE team. So short sighted. *** Apple?

Looking at the navigator object in Safari for iOS 13.6 there is a maxTouchPoints property,

iPad
navigator.maxTouchPoints returns 5

Desktop
navigator.maxTouchPoints returns 0

I’m not sure how far back the maxTouchPoints property goes, but checking this property exists and if so whether it has a value greater than 0 could be a work-around.

Источник

Question: Q: internet Explorer user agent

I want to use the Internet Explorer user agent from the Develop tab to use a specific website. However on my version of Safari (13.0.3) none of the IE versions are shown — only Edge. I have tried searching for the user agent strings but cannot find them.

Can anyone help how to install those user agents into Safari ?

MacBook Pro 13″, macOS 10.14

Posted on Nov 14, 2019 2:37 PM

Helpful answers

im having the exact same problem . there was a IE extension that used to be free on chrome as well and now they want to charge u for it . I usually use the developer tab but my computer auto updated itself to 13.0.3 and not IE is gone .

Nov 18, 2019 6:10 AM

There’s more to the conversation

Loading page content

Page content loaded

  1. Have you tried Microsoft Edge as the User Agent?
  2. Try ‘Other» at the bottom of the pop-up, enter the user agent string and «OK».

Nov 15, 2019 3:27 AM

We have been told Edge will not work on this website — IE only. I would put a string into the other filed if I could find one for IE. I have searched the Web and find all sorts for Chrome etc but I cannot find a string to paste for IE of any version to run on Safari 13

Nov 15, 2019 4:07 AM

I couldn’t find Safari 13 specific IE user agent string either.

If Apple don’t provide one, it is going to be tough to get IE user agent string working.

Do you have clone backup with previous version of Safari installed?

Nov 15, 2019 10:27 AM

im having the exact same problem . there was a IE extension that used to be free on chrome as well and now they want to charge u for it . I usually use the developer tab but my computer auto updated itself to 13.0.3 and not IE is gone .

Nov 18, 2019 6:10 AM

Nov 18, 2019 6:44 AM

Thanks for the link but they all seem to be for Windows machines. I need the string for IE on OS X 13 ? Unless I am reading those incorrectly.

Nov 22, 2019 9:00 AM

There has not been an Internet Explorer version for Mac in 16 years. There is no user Agent String that would Identify a current Internet Explorer version on a Mac.

But not sure why you need that. If you just want to trick the website into thinking you are using Internet Explorer, then any current version of Internet Explorer you would be using would have to be on Windows, so those strings should work.

Читайте также:  Windows server device cal что это такое

Источник

Question: Q: How do you change User Agent in Safari?

powerbook g4, Mac OS X (10.5.2)

Posted on Feb 21, 2008 4:00 PM

Helpful answers

Welcome to Apple Discussions

You’ll need to activate the Debug menu first.
First, quit Safari.
Open Terminal.app in your Utilities folder.
When the Terminal window opens, copy & paste the following command into the window:

defaults write com.apple.Safari IncludeDebugMenu 1

Press «return», you may be prompted for an admin password. If so, enter it.
If necessary, press «return» again.
When you see your Mac’s name, the Terminal entry is done.
Quit Terminal
Restart Safari and go to the Debug Menu. There, you’ll find the User Agent selections.

Feb 21, 2008 4:10 PM

There’s more to the conversation

Loading page content

Page content loaded

Welcome to Apple Discussions

You’ll need to activate the Debug menu first.
First, quit Safari.
Open Terminal.app in your Utilities folder.
When the Terminal window opens, copy & paste the following command into the window:

defaults write com.apple.Safari IncludeDebugMenu 1

Press «return», you may be prompted for an admin password. If so, enter it.
If necessary, press «return» again.
When you see your Mac’s name, the Terminal entry is done.
Quit Terminal
Restart Safari and go to the Debug Menu. There, you’ll find the User Agent selections.

Feb 21, 2008 4:10 PM

Feb 21, 2008 4:23 PM

Feb 21, 2008 4:24 PM

Feb 21, 2008 4:40 PM

Now for the next question, how do you view a webpage that is whitten in .aspx instead or .html?

aspx is a Microsoft code. What’s the URL?

Feb 21, 2008 5:22 PM

Feb 21, 2008 5:42 PM

Mar 23, 2008 5:36 PM

You don’t have to do anything special to view an .aspx page, it just works. If it isn’t working for you, then you have other problems. For instance, here’s a site that uses a .NET back-end that works fine in Safari:

Does the above work for you?

Btw, changing Safari’s userAgent might get you past some scripts, but you may then recieve browser-specific code that is incompatible with Safari, causing other issues. Your mileage may vary, etc.

Mar 23, 2008 5:49 PM

Your advice regarding the Debug menu no longer applies to Safari 3.1. There is no Debug menu in Safari 3.1. Instead there is a Develop menu that can be activated through Safari 3.1’s preferences. Navigating to Preferences->Advanced reveals a «Show Develop menu in menu bar» check box. Activate this menu and you can change user agents from a drop down menu. No longer any need to enter a terminal command! Neat!

Mar 23, 2008 6:45 PM

Does anyone have a way to turn off «Automatically Chosen» as the default user agent setting and establish one of the profiles in the list as the new default profile? Thanks.»

No, there is no way to make the user agent change permanent. Why would Apple even allow something like that? The older Debug menu and Safari 3.1’s new Develop menu were added for one purpose only, to assist in problem solving and cross platform development. If you want to permanently change user agents why not just change browsers or operating systems altogether? This defeats the whole purpose of using profiles so that web sites can taylor pages to the particular quirks of certain browsers and for security reasons. And as someone else has pointed out changing the user agent doesn’t change anything about the operation of Safari. All it does is identify to the web site that the specified browser is present when in reality it is not. You’re just fooling the web site, not changing any behavior. Personally I have not encountered ANY web sites in the past two years at least that refused to respond to the Safari browser.

Источник

Оцените статью