9
0 Comments

Yesterday was excruciating and depressing

Yesterday was excruciating and depressing. I've found that Safari fails to insert scripts from the same domain using document.createElement, firing script.onerror event. This thing worked for years, so I went to sleep unhappy and scared, because if I couldn't solve the issue, I would need to drop optimizations for a huge Safari browser market. There were two solutions to that

  1. redirect Safari users to a non-optimized version of the site, effectively disabling optimizations for all Safari users.
  2. detect Safari and add crossorigin=anonymous, which doesn't make sense for scripts loaded from the same host.

In the morning I figured out my VPN was up - I was solving an issue for a WP Meteor user and has to do that using VPN. Once VPN was disabled - everything returned back to normal. Also, everything was working perfectly when using VPN on a real site. It turned out the issue is only present when using VPN AND running on localhost AND 'Prevent cross-site tracking' enabled in Safari settings (it is by default). Looks more like a bug in Safari.

I'm back to normal #buildinpublic

As everyone says being an entrepreneur is tough mentally. Especially when you figure out all the brilliant job you did for the last 2 years might be wiped out in an instant

on September 9, 2022