News for hackers. Stuff that matters.
Re:Apple is not defending browser engine choice by SCLeo on Friday June 24, 2022 @08:19AM (#31860651)
Literally an hour ago, I ran into an issue where Safari does not support lookbehind in regular expressions. https://caniuse.com/js-regexp-lookbehind

Say what you want but it is so frustrating when you run into problems like this. It does remind me of old IE days where we had to produce one gazillion hacks for IE.

Re:Apple is not defending browser engine choice by nsonha on Friday June 24, 2022 @10:40AM (#31862693)
Doesn't Safari have superior baterry life?

People have different priority, most end user gives no fuck about the pile of garbage APIs that just keeps growing in modern browsers, they just wanna read some stuff. When developers cry about their "api", some kid in africa isn't able to access knowledge on ther internet because sites have to use look behind or whatever.

Re:Apple is not defending browser engine choice by mythz on Friday June 24, 2022 @09:09AM (#31861186)
I had the same issue & had to rewrite not to use RegEx [1], but if that's the main issue people are running into, it's a non-issue that can easily be worked around.

Personally I find Safari a great browser on iOS and prefer not to add to the test matrix burden with different browser engines on iOS. Also this restriction is the only thing keeping Chrome from dominating the future of Web, who can't be trusted to not use it as an anti competitive weapon as we've seen with AMP.

[1] https://stackoverflow.com/a/71168150/85785

Re:Apple is not defending browser engine choice by MCArth on Friday June 24, 2022 @09:29AM (#31861484)
It's not just regex, it's a long list of features and bugs. The OP was simply giving an example. I've encountered many time-wasting bugs on safari in the past, which have simply been open for several years.
Re:Apple is not defending browser engine choice by guhidalg on Friday June 24, 2022 @10:50AM (#31862936)
I think you should be penitent for using too-new JS features.
Re:Apple is not defending browser engine choice by ntoskrnl on Friday June 24, 2022 @08:47AM (#31860943)
I second this. I hit a goofy issue recently too: Safari can't select text in text boxes... but only sometimes. What causes it is unclear. Out of this mountain of workarounds, I had to use setTimeout: https://stackoverflow.com/questions/3272089/programmatically...

And in Safari there's zero visibility into why things break, they just silently don't work. At least Chrome is pretty good (in my experience) about throwing an exception or at least logging warnings to the console

Re:Apple is not defending browser engine choice by honkdaddy on Friday June 24, 2022 @08:31AM (#31860790)
In this situation, grabbing a 3rd party JS regex library for a handful of kilobytes probably solves your problem, but I’m sure that crossed your mind.

Is it really as bad as the IE days though? I didn’t work on web back then, but these days if I run into a safari comparability issue, the workaround is usually pretty painless.

Re:Apple is not defending browser engine choice by tomgp on Friday June 24, 2022 @08:45AM (#31860917)
I did work on the web back in those days. The situation now is nothing like it was during IE's dominance in the early 2000s, to claim it is is hyperbole at best.
Re:Apple is not defending browser engine choice by RobertRoberts on Friday June 24, 2022 @09:19AM (#31861319)
You are right, it's worse because the problem is more hidden and therefore a lot harder to solve.

At least in the IE days everyone _knew_ IE was a problem, so we were looking for a solution as a community. Now? We comments that are dismissive of crap instead of inspiring towards quality.

Re:Apple is not defending browser engine choice by lern_too_spel on Friday June 24, 2022 @09:51AM (#31861799)
In the IE days, you could tell the visitor to use Firefox. iOS does not allow such an easy fix.
Re:Apple is not defending browser engine choice by SCLeo on Friday June 24, 2022 @08:44AM (#31860907)
I do not believe there is a 3rd party polyfill for lookbehind as it is quite tricky to implement regular expressions. If you found one, please let me know. Thanks in advance.
Re:Apple is not defending browser engine choice by ntoskrnl on Friday June 24, 2022 @08:50AM (#31860974)
There's always this: https://xregexp.com/

But it's not really a polyfill, just a library.

Re:Apple is not defending browser engine choice by eyelidlessness on Friday June 24, 2022 @08:54AM (#31861013)
On mobile and can’t tell whether xregexp still doesn’t have lookbehind, but in case it doesn’t I found this: https://github.com/beaugunderson/xregexp-lookbehind