Testing a website using Safari on Linux

I run linux and use virtualbox to cross browser test my website. I have Windows10 and Windows7 within virtual box which allows me to test the site with IE and Edge browsers.

I have never used Apple/Mac OS so I am very much in uncharted territory here. I need to test the site on Safari but after searching online, it appears as though it isn't possible to download a MacOS ISO to install in virtualbox: link (I do not have access to an apple computer)

I tried installing Safari on a windows VM but it is a really old version since Safari is not supported on Windows. Also, from what I can tell there are no Linux versions of Safari.

Is there a way to test the site using Safari somehow without owning a Mac?


Solution 1:

While it's not entirely the same thing, you could use one of the WebKit Linux ports to run "mostly Safari" on Linux. However, if you're intent on running macOS on non-Apple hardware, there are ways. However, note that these methods may violate Apple's macOS SLA.

According to Apple's macOS 10.12 SLA, you may use your limited, non- transferable, non-exclusive license:

to install, use and run up to two (2) additional copies or instances of the Apple Software within virtual operating system environments on each Mac Computer you own or control that is already running the Apple Software, for purposes of: (a) software development; (b) testing during software development; (c) using macOS Server; or (d) personal, non-commercial use.

From a technical perspective, there's nothing that would prevent you from running a VM on non-Apple hardware, though you would clearly be in violation of the SLA, and as such, I can't recommend you do this. However, if you decide to run a VM on Apple hardware, it's possible to create a compatible ISO. In any case, you'd need access to a macOS equipped machine.

Again, while clearly in violate of the SLA, there are methods to put macOS on non-Apple hardware, generally known as Hackintoshing. Again, I cannot condone this, but it is technically possible.

The easiest and most legally clear method is still to run Safari on Apple hardware, and that's what I'd recommend.

Solution 2:

Simple answer would be No - there isn't. But there are some workarounds.

  1. Use inline service like browserstack

  2. Use old (unsupported) version of Safari on Windows

  3. Use browser which seems to have similar rendering engine:

  • Gnome web - installed by default on Ubuntu
  • Midori Browser - Since 2019 Midori is based on Electron (Chromium)

For me going 3) helped to debug most of Safari rendering problems, so I can only recommend Gnome Web and Midori browser.

Solution 3:

Safari is based on the WebKit rendering engine, though is of course exclusive to Apple hardware. Chrome, before forking its proprietary Blink rendering engine, was using WebKit so that is a somewhat close comparison.

The download page on the WebKit website links to a GTK port for Linux which might be enough to serve your purposes.