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

Handle same-tab navigation #16

Open
basilevs opened this issue Feb 16, 2020 · 2 comments
Open

Handle same-tab navigation #16

basilevs opened this issue Feb 16, 2020 · 2 comments

Comments

@basilevs
Copy link
Owner

basilevs commented Feb 16, 2020

Test steps

  • Open Spotify
  • Pin its tab
  • Open a new tab
  • Navigate to Google
  • Search for Spotify
  • Click on it (without opening a new tab)

Expected

  • Pinned Spotify tab is focused
  • A new Spotify URL from search result clicked is loaded in it
  • Search result tab is left opened (but inactive), search results are left as they are, ready to be viewed again

Actual

The tab is left with Spotify and you turn up having 2 Spotify tabs.

A request from user review :
https://addons.mozilla.org/en-US/firefox/addon/reuse-tab/reviews/1344107/

@basilevs basilevs added this to the 0.12 milestone Feb 16, 2020
@basilevs basilevs changed the title Intercept in-tab navigation Intercept same-tab navigation Feb 16, 2020
@basilevs basilevs changed the title Intercept same-tab navigation Handle same-tab navigation Feb 16, 2020
@basilevs
Copy link
Owner Author

basilevs commented Feb 16, 2020

Loading previous page upon webNavigation.onCompleted would cause page of origin to be reloaded, losing its scroll position
Navigation can be cancelled in webRequest.onBeforeRequest

@basilevs basilevs removed this from the 0.12 milestone Feb 17, 2020
@basilevs basilevs self-assigned this Feb 26, 2020
@basilevs
Copy link
Owner Author

basilevs commented Mar 1, 2020

A prototype is ready in branch #16_sameTab

It requires "<all_ulrs>" permission to stop navigation in tab of origin.
This permission is too significant and should not be requested unless absolutely necessary.

TODO:

  • consider backtracking instead of stopping navigation.
  • check if "activeTab" permission instead of "<all_ulrs>" is enough. It may allow to intercept requests even if this potion is not explicitly stated in its description. Even if interception is not allowed, it may be possible to use code injections to modify page behavior.

@basilevs basilevs removed their assignment Oct 9, 2024
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

1 participant