Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For some unknown reason, whenever the extension intercepts and uses an event in Safari like this:
Safari will throw the error:
null is not an object (evaluating 'event.detail.url')
In this case the error comes from this function inside the Turbo repo:
Specifically this line:
However, the following code works without any issues in Safari:
or even:
It seems like as soon as we try to use the entire event object, the custom properties like
event.detail
are lost in Safari.This behaviour only occurs in Safari and only when a browser extension intercepts the event.
When you use the same event listeners in a ordinary application code, everything works as expected.
I currently have no idea why this is happening or how we can prevent it.
The only hacky workaround that seems to work is to use a setTimeout with some delay.
Not ideal and I hope we can find a better solution in the future. But in the meantime it's better than nothing. I guess.