Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tampermonkey + at least one more extension can make Safari forget that an iframe-based top level navigation was triggered by a user gesture #1836

Closed
dimdom69 opened this issue Aug 15, 2023 · 13 comments

Comments

@dimdom69
Copy link

dimdom69 commented Aug 15, 2023

I am on 4.20.6184 and I am still having the exact same issue as described in issue #1536

Untitled

Safari: Version 16.6 (18615.3.12.11.2)
TM: 4.20.6184
OS: MacOS Ventura 13.5 (22G74)

Originally posted by @lehrian in #1536 (comment)

@isokaze04
Copy link

same issue here.

@viliam-husar
Copy link

same issue here.

Safari: Version 16.6 (18615.3.12.11.2)
TM: 4.20.6184
OS: MacOS Ventura 13.5 (22G74)

@derjanb derjanb added the safari label Aug 29, 2023
@dewey
Copy link

dewey commented Sep 1, 2023

I have the exact same configuration as @viliam-husar and I'm also running into the issue. Took me a while to narrow down where this issue was coming from.

Happy to assist with logs or debug information in case there's anything that makes it easier to track down.

@derjanb
Copy link
Member

derjanb commented Oct 17, 2023

Duplicate of #1840

I guess you all have 1Password installed?

@derjanb derjanb closed this as completed Oct 17, 2023
@dimdom69
Copy link
Author

Excuse me? No I do not have 1Password installed. Maybe wait a few minutes before closing the issue to get a response to your question.

@derjanb

This comment was marked as outdated.

@derjanb
Copy link
Member

derjanb commented Oct 17, 2023

Google search navigates the top frame from an iframe. Not sure why this is necessary, but this triggers a Safari bug that makes the browser forget that the whole action was triggered by a user gesture.
And it looks like that it forgets about that depending on the amount of time or work that passed since the click. That's why two extensions are necessary to trigger the issue. At the moment there is nothing I can do to fix the issue.

I'll look into writing a userscript that directly navigates to the search entries instead of creating an iframe to start the tab navigation later.

https://html.spec.whatwg.org/multipage/browsers.html#sandboxed-top-level-navigation-with-user-activation-browsing-context-flag

@derjanb derjanb changed the title I am on 4.20.6184 and I am still having the exact same issue as described in issue #1536 Tampermonkey + at least one more extension can make Safari forget that a iframe-based top level navigation was triggered by a user gesture Oct 19, 2023
@derjanb derjanb changed the title Tampermonkey + at least one more extension can make Safari forget that a iframe-based top level navigation was triggered by a user gesture Tampermonkey + at least one more extension can make Safari forget that an iframe-based top level navigation was triggered by a user gesture Oct 19, 2023
@derjanb
Copy link
Member

derjanb commented Oct 26, 2023

Please try this userscript. It fixes the issue here. If you still see issues, then please open the "Web Inspector" and check whether the selector used at document.querySelectorAll matches the anchor tag (<a>) you've clicked. Thanks.

https://gist.github.com/derjanb/d4506acc43ae8692c4ceddb0e387ccca/raw/Fix%2520Google%2520Navigation.user.js

@derjanb derjanb closed this as completed Oct 26, 2023
@dewey
Copy link

dewey commented Oct 27, 2023

Thank you, this seems to fix the issue for me and I can use Tampermonkey again!

@jpmontez
Copy link

It works for most links on a results page. However, if you try and click Wikipedia links on the sidebar or YouTube videos or anything not a general search result, it clicks don't work.

@derjanb
Copy link
Member

derjanb commented Oct 30, 2023

@jpmontez It's workgin fine here with these links too.

Can you please open the Web Inspector, click the crosshair symbol (red) and select a link (red) that is not working.
Then search the next outer <a tag (green) and check whether it has a data-ved attribute (green). How does the element look for you?

image

@jpmontez
Copy link

Deleted a previous comment to show a Wikipedia link on the sidebar instead. Included is the screenshot showing the a tag. I've also disabled all other extensions except for 1Password and Tampermonkey.

Screenshot 2023-10-30 at 4 13 21 PM

@jpmontez
Copy link

I just found the problem. There was a blacklist on the page that was preventing the script from loading. I removed it and now the links work. Thanks for looking into this, though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants