Page 1 of 1

Feature request - links open in a new tab

Posted: Thu Jan 26, 2023 9:08 am
by leosmith
This is not a deal breaker, but it would be nice to have.

Re: Feature request - links open in a new tab

Posted: Thu Jan 26, 2023 11:07 am
by rdearman
leosmith wrote:This is not a deal breaker, but it would be nice to have.

This actually caused massive wars on the PhpBB developers website with miles of text. Basically, there are a lot of arguments both for and against. The primary one for is allows users to maintain their place on the forum. The main argument against is that it breaks the W3 standards and the user should be allowed to control if they open a new window (tab) and the user should decide if they want to click the link, or right-click the link and allow new windows to open. The other argument against is from a security point of view, but I got tired of reading it all.

The upshot of that discussion was that the developers decided they would strictly follow W3 standards and as of version 3.0 phpBB would no longer automatically open URL's in new windows.

There is an extension which will change the default rules on URL clicking, but it is reported as buggy and only works part of the time. So.... long story short, I'm afraid you're going to have to make a little extra effort and right-click (and/or middle mouse click on Windows) to open in a new window or tab.

Re: Feature request - links open in a new tab

Posted: Thu Jan 26, 2023 12:36 pm
by leosmith
Ah, ok. No worries.

Re: Feature request - links open in a new tab

Posted: Thu Jan 26, 2023 1:17 pm
by Odair
Ctrl+click or pressing down on your mouse wheel will open any link on a new tab.

Re: Feature request - links open in a new tab

Posted: Thu Jan 26, 2023 2:04 pm
by rdearman
Odair wrote:Ctrl+click or pressing down on your mouse wheel will open any link on a new tab.

On Microsoft Windows and most web-browsers. (This is why I'm careful to caveat advice to people, since I don't know their operating system or web-browser. For all I know, Leosmith could be using Lynx inside a Linux terminal window, or using Emacs on a Mac.) :)

Re: Feature request - links open in a new tab

Posted: Thu Jan 26, 2023 2:20 pm
by leosmith
rdearman wrote:
Odair wrote:Ctrl+click or pressing down on your mouse wheel will open any link on a new tab.

On Microsoft Windows and most web-browsers. (This is why I'm careful to caveat advice to people, since I don't know their operating system or web-browser. For all I know, Leosmith could be using Lynx inside a Linux terminal window, or using Emacs on a Mac.) :)
I've always just rt clicked.

Re: Feature request - links open in a new tab

Posted: Sun Jan 29, 2023 12:50 am
by Stefan
There's probably a setting or generic browser plugin for this but you could use a Tampermonkey script.

I threw this together which allows you to whitelist keywords in URLs such as "#top" to avoid those being opened in a new tab.

Code: Select all

// ==UserScript==
// @name         Open links in a new tab
// @namespace    https://forum.language-learners.org
// @version      0.1
// @match        https://forum.language-learners.org/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=language-learners.org
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const whitelist = [
        "posting.php",
        "#top",
    ];

    for (const link of document.querySelectorAll("a")) {
        if (!whitelist.some(term => link.href.includes(term))) {
            link.target = "_blank";
        }
    }
})();


When a page on this domain is loaded, it iterates through all the links and adds target="_blank" to them which results in them opening in a new tab/window. It's a new tab for me but I believe it used to be window way back. You would need to have Tampermonkey or Greasemonkey installed as a browser plugin. Maybe not the most efficient way to solve it.