libredirect / browser_extension

A browser extension that redirects popular sites to alternative privacy friendly frontends
https://libredirect.github.io
GNU General Public License v3.0
3.25k stars 121 forks source link

Enhancement: Opening FreeTube from LibRedirect extension should not create a new empty tab #198

Closed 0x6e656b6f closed 2 years ago

0x6e656b6f commented 2 years ago

Describe the bug

  1. Click on Youtube link.
  2. A new empty tab and a FreeTube window opens.

Expected Behavior

Clicking a Youtube link should only spawn a Freetube window.

Additional Information

Web browser version: Librewolf 99.0 LibRedirect version: 1.6.3

ManeraKai commented 2 years ago

You can just check the box in the popup that says: Always use this application to open freetube link and it won't show a popup and will open a Freetube window right away.

0x6e656b6f commented 2 years ago

That's not what I meant. Even if I check the box, the extension will still create a new empty tab in my browser and I need to manually close the tab. I want the extension to not create an empty tab on the browser.

IkelAtomig commented 2 years ago

That seems very odd. Export your settings and Can you try to reinstall the extension again ?

ManeraKai commented 2 years ago

No no he's right, It keeps an empty tab opened even if you check it; I tested that myself. Didn't the same happened to you @EdwardLangdon when opening a link from other app?

IkelAtomig commented 2 years ago

No

0x6e656b6f commented 2 years ago

No no he's right, It keeps an empty tab opened even if you check it; I tested that myself. Didn't the same happened to you @EdwardLangdon when opening a link from other app?

It doesn't open a new empty tab on Chromium-based browser (I tested it on Brave). But on Firefox-based browser (like Librewolf) it opens a new empty tab.

ManeraKai commented 2 years ago

Isn't this just regular browser behavior?

ManeraKai commented 2 years ago

I'm trying to add it but it just doesn't work and closes of the window before the user finishes working with the popup. I may get complex and inject a script in the site and see if there's a popup or not or when it was closes but this is really complex and unpractical. Sorry...

0x6e656b6f commented 2 years ago

Found the solution. You just need to set browser.link.open_newwindow to 1. Doing that will prevent the browser from creating new empty tab whenever you open links.

IkelAtomig commented 2 years ago

browser.link.open_newwindow

I do also use Arkenfox with value to 3 as defined by user.js. But, It doesn't.

@ManeraKai Is there way to check this ?

ManeraKai commented 2 years ago

I really didn't use Arkenfox at all. What do you mean by checking?

m77e4t commented 2 years ago

You will need to override it via a 'recipe'. https://github.com/arkenfox/user.js/wiki/3.1-Overrides https://github.com/arkenfox/user.js/wiki/3.4-Apply-&-Update-&-Maintain#-apply

Go to # 4512 and set it to 1 instead of 3 in the override user js. The run the updater.sh and then run your arkenfox browser.

(You may be talking something other than I mentioned above, if so ignore this comment)

0x6e656b6f commented 2 years ago

I decided to reopen this issue because after changing set browser.link.open_newwindow to 1, it results in an annoying behavior. It's easier to explain with an example so I'm going to give an example. Say you're in github.com and opens youtube.com, it opens Freetube without also opening a new empty tab. Then in Freetube, someone links a GitLab URL. When I click that URL, instead of spawning a new tab and loading GitLab in that tab, it replaces the current github.com tab.

0x6e656b6f commented 2 years ago

browser.link.open_newwindow

I do also use Arkenfox with value to 3 as defined by user.js. But, It doesn't.

@ManeraKai Is there way to check this ?

I'm also interested in this comment. However, I currently can't test this so hopefully someone can test it.

One thing for sure is browser.link.open_newwindow isn't the correct setting to change.

0x6e656b6f commented 2 years ago

I think I finally get it to work. Changing browser.link.open_newwindow to 1, browser.link.open_newwindow.restriction to 0, and browser.link.open_newwindow.override.external to 3 (previously it's -1). Finally resulted in the correct behavior as I expected.

IkelAtomig commented 3 weeks ago

I think I finally get it to work. Changing browser.link.open_newwindow to 1, browser.link.open_newwindow.restriction to 0, and browser.link.open_newwindow.override.external to 3 (previously it's -1). Finally resulted in the correct behavior as I expected.

There is a problem with this. If you have DuckDuckGo or any webpage to open links in new tab by default. That option is overridden and opened in the same tab. So, When you want to open links in new tab, you always have to use it by Ctrl + Left click.