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

Do not open popup when not needed #86

Open
rugk opened this issue Nov 22, 2022 · 4 comments
Open

Do not open popup when not needed #86

rugk opened this issue Nov 22, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@rugk
Copy link
Owner

rugk commented Nov 22, 2022

Background

In #84 @hueyy implemented support for Mastodon v4.
I also plan to enable "skip popup" by default now, since the popup is not a known concept for Mastodon v4 users now.

However, the problem then persists that if you enable "popup closing" (see #44) this the popup quickly opens and closes, which is just not needed, really, as we just do that to re-implement/keep the legacy way of how it worked. See #83 (comment).

Proposed solution

The content script needs to communicate the username or other data back to the background script where to navigate, which then triggers the tab navigation…

Actually, easier: Instead of opening target="_blank" we can just switch to the default target/target "_self_", i.e. the same window in the content script triggers. The redirect should work as usual. This still needs to pass that setting to the content script from the background script, but that is okay/possible reasonably.

  • we can remove the legacy code that closes the popup or so then, it should not happen. (but we need to keep care of how other Fediverse instances do it then)

Also UI things:

  • maybe invert the logic of the popup setting if it by defailts opens no popup to be "Open in new popup".

Alternatives

Leave it as it is. I consider this an iteration over the previous features, as it is "just" a minor inconvenience and opens a new popup. And would be quite some implementation effort, as it changes the add-on again fundamentally.

Additional context

@rugk
Copy link
Owner Author

rugk commented Dec 13, 2022

@hueyy are you interested in having a look here for further improving the whole mechanism? It goes into simpler WebExtension stuff. There are also maintenance tasks like #50 and I've found another extension that did the same as we did (unfortunately only now), that may have done things better or can at least be used for inspiration: raikasdev/mastodon4-redirect#6

@hueyy
Copy link
Contributor

hueyy commented Dec 13, 2022 via email

@raikasdev
Copy link

raikasdev commented Dec 15, 2022

Hey! I have also thought about an another idea: What if instead of redirecting or something, the follow/interact button clicks are listened to, preventing default listeners and then using OAuth to do the action?
I believe that people will want to still be on the users page maybe after the action as (at least on) Mastodon4 requires you to go to other instances to view older posts.

- Roni

@rugk
Copy link
Owner Author

rugk commented Dec 30, 2022

While that may be possible, I see a technical risk here. The TL;DR is that you cannot see who you are interacting with, because a website may fake/show anything, where you can click on.

I elaborated on this on Mastodon already, because a different extension works like that, but have not yet proven it by testing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants