Need Open ALL Links in New Tab with Changing Focus Solution

User Help for Mozilla Firefox
Post Reply
Wiggam72
Posts: 451
Joined: July 30th, 2013, 9:05 am

Need Open ALL Links in New Tab with Changing Focus Solution

Post by Wiggam72 »

Is there a SeaMonkey script, css code, or something in about:config that can automatically open and switch focus on ALL links including YouTube and Facebook in a new tab without interfering with my installed add-ons, or negate the use of the add-ons?

I have the add-ons 'My Homepage', 'Open bookmarks in new tab' and 'Open Link in New Tab' installed. 'Open Link in New Tab'' works well for 98% of the links I open but will not work in almost all links in FB and none in YouTube and the occasional other sites I visit.

I know that I can press Ctrl while clicking the link, but the focus doesn't switch to the new tab and, I don't want to have to press anything to have the link open in a new tab and have the focus switch to the new tab.

'Open bookmarks in new tab' works for YouTube and I assume it would for Facebook too, but have never saved a bookmark for FB.
User avatar
MarkRH
Posts: 1361
Joined: September 12th, 2007, 2:30 am
Location: Edmond, OK
Contact:

Re: Need Open ALL Links in New Tab with Changing Focus Solut

Post by MarkRH »

In about:preferences did you check the box to "When you open a link in a new tab, switch to it immediately" option?

You might also want to set the following to true in about:config -

browser.search.openintab
browser.tabs.loadBookmarksInTabs (setting this to true can probably get rid of that "Open bookmarks in new tab" extension.)
browser.urlbar.openintab

YouTube is doing some funky stuff.. there's no actual Anchor elements.. JavaScript is creating links out of DIVs or custom tags. Right-click on a link and do Inspect Element. That "Open Link in New Tab" extension probably has no idea these are even links.
Wiggam72
Posts: 451
Joined: July 30th, 2013, 9:05 am

Re: Need Open ALL Links in New Tab with Changing Focus Solut

Post by Wiggam72 »

Sorry I took so long. I had an issue with a FF update and it took me some time to figure out what triggered the update to break my Profile.

I tried changing those configurations but they didn't work. I haven't run into any of the random links yet, but FB and YouTube still don't work. I'll keep the settings until I run into one of those random links that won't open in a new tab to see if the settings work on those.

The browser.tabs.loadBookmarksInTabs was already set to True.
User avatar
jscher2000
Posts: 11772
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Need Open ALL Links in New Tab with Changing Focus Solut

Post by jscher2000 »

There is no setting to turn regular links (not targeted to a new window) into links that open in a new tab. But there's an add-on for that:

https://addons.mozilla.org/firefox/addo ... h-new-tab/
User avatar
dickvl
Posts: 54164
Joined: July 18th, 2005, 3:25 am

Re: Need Open ALL Links in New Tab with Changing Focus Solut

Post by dickvl »

Some focus and link loading related prefs:
browser.tabs.loadInBackground (normal links)
browser.tabs.loadDivertedInBackground (javascript and external links)
browser.tabs.loadBookmarksInBackground (bookmarks)
browser.search.context.loadInBackground
browser.tabs.loadBookmarksInTabs
Wiggam72
Posts: 451
Joined: July 30th, 2013, 9:05 am

Re: Need Open ALL Links in New Tab with Changing Focus Solut

Post by Wiggam72 »

Thanks for the help, but unfortunately changing things to True actually prevented the tabs from opening in a new tab, or it didn't switch to the new tab immediately, so I had to switch them all back to false except for browser.tabs.loadBookmarksInTabs that my add-on changed. I kept the add-on.
jscher2000 wrote:There is no setting to turn regular links (not targeted to a new window) into links that open in a new tab. But there's an add-on for that:

https://addons.mozilla.org/firefox/addo ... h-new-tab/
After uninstalling, and trying the one you posted, I reverted back to the add-on I was using. 'Open Link in New Tab'.
MarkRH wrote:In about:preferences did you check the box to "When you open a link in a new tab, switch to it immediately" option?

Thanks, I forgot about that for the new Profile I made. I'm using the Profile that the problem originated with. All seems to be working fine now except for YT and FB. It appears those sites are configured in a way that won't allow the links to open in a new tab without using Shift (on the keyboard) or the (right-click) context menu.

As far as the new Profile, there are only a few minor things I haven't installed like Stylus, pasting links in My filters in uBlock Origin and maybe something else. I'll leave it for a rainy day in the event something happens to this one.

EDIT: I meant to write Ctrl to open in a new tab. Using Shift opens in a new window.
Last edited by Wiggam72 on March 28th, 2019, 3:10 am, edited 1 time in total.
User avatar
jscher2000
Posts: 11772
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Need Open ALL Links in New Tab with Changing Focus Solut

Post by jscher2000 »

I skipped over the post that you have 98% working the way you want but 2% do not work. Are they real links, meaning, if you right-click them, do they have the Open Link in items? Many sites use scripted "buttons" or clickable areas to simulate links, but Firefox does not treat them as links. If they are links, a script attached to the link may be blocking the standard link action. Other than removing the script, I don't think there is a convenient way to solve that.
Post Reply