Hey everyone! It’s been a while... ? I recently ran into a tricky situation where I had to debug an issue happening specifically on Safari while working on a Windows machine. Let’s just say—it was a challenge. ?
Thankfully, I stumbled upon an awesome article:
? Test Your Site in Every Browser
This article introduced me to a handy trick using Playwright. With a simple command, you can open a browser that uses the WebKit engine (the same engine Safari is built on) and pause it, giving you full control to:
While this approach was a game-changer, it wasn’t a complete solution for my case. I needed to debug a specific major version of Safari, and WebKit alone didn’t quite cut it.
Here’s where it got interesting:
I dove into the Playwright changelog, where I discovered that it maps Playwright versions to specific WebKit versions. Using this information, I was able to emulate the Safari version I needed, by installing that version instead! ?
What’s even better? The emulated browser allows you to open DevTools, making it easier to inspect and debug issues. This saved me tons of time and effort—without needing access to a physical macOS device.
Of course, there might be some limitations I haven’t encountered yet, like file uploads or other advanced functionality. But for my use case, this was an effective and FREE solution that worked perfectly.
If you have any other suggestions for testing Safari on non-Mac devices, I’d love to hear them! From what I’ve seen, most services offering Safari emulation are either trials or require a paid subscription, so finding a free alternative like this was a gem. ?
Happy coding! ?
The above is the detailed content of Testing out Safari on Windows (older versions too). For more information, please follow other related articles on the PHP Chinese website!