etacarinaea / startpage

a simple and customisable startpage
GNU General Public License v3.0
148 stars 35 forks source link

Opening links to window/tab based on user's preference #7

Closed tonydefilippis closed 7 years ago

tonydefilippis commented 7 years ago

Hello, Not a true issue here, but have you considered having the page links open a new tab or window based on the user's preference? (by preference here i mean the browser options they have set beforehand) It's a simple fix I did myself by adding this line as line 24 of the square.js file: linkElements[i].setAttribute("target","_blank");

and for the search by changing line 98 in main.js from window.location = .... to: window.open(searchsquare.links[i].url + query.replaceChars(" ", searchsquare.links[i].space), "_blank"); I might submit a pull request for these changes but they are really minor. Thanks, snek

etacarinaea commented 7 years ago

The standard behaviour of _blank is opening the link in a new tab or window, so for most users this would be the case. FF lets you change that behaviour, but I think the reason the option exists is to prevent pages from opening new tabs/windows when they actually shouldn't (e.g. just clicking on normal hyperlinks). I'm also not sure if you're able to do that in Chrome for example.

I also don't see the point in opening pages in a new tab or window, at least with the way I'm using it. I'd probably just open a new tab (with the startpage as the newtab page obviously) for every link I want to open or I could also middle-click on the link(s) I want to open in a new tab.

That's why I think it'd be better to keep it like it's now, but thanks for the suggestion