Javascript making browser ignore new tab settings

General discussion about the NoScript extension for Firefox
Post Reply
sgyuvvdzvd
Posts: 1
Joined: Wed Mar 16, 2011 10:01 pm

Javascript making browser ignore new tab settings

Post by sgyuvvdzvd »

A website's forums that I use has some annoying functionality and I am hoping NoScript can deal with it, perhaps with a surrogate script?

My browser is set such that new windows will open a new tab, in the background. When I middle click or control click on links they open in new background tabs, as does a right-click and picking "open in new tab".

Apart from 1 site's forums (http://www.uk420.com/boards/?act=idx), where if I have JS enabled[1] control clicking on external links causes the browser to open a new foreground tab (this problem may occur on other sites too, but I have not noticed). No where in my browser is it set to open stuff in the foreground, and if I turn off JS then normal behaviour is resumed on ctrl-clicking. If I middle click or right-click and pick "open in new tab" they open in the background with JS enabled or disabled.

On the site though, only external links cause this irritating behaviour. A ctrl-click on anything internal to the site behaves as expected with JS enabled or not. The site uses a property of rel='external' on external links though, and I presume this is how the browser knows to annoy the crap out of me or not.

In fact, a script file ( http://www.uk420.com/boards/public/min/ ... pb.lang.js ) contains the following, and I guess this is the crux of the issue?:

Code: Select all

ipb.delegate.register('a[rel~="external"]',ipb.global.openNewWindow);
For a simple example, see this link:
http://www.uk420.com/boards/index.php?showtopic=258543

The MORE link posted by Spliffter has the following properties:

Code: Select all

Address: http://www.coventrytelegraph.net/news/coventry-news/2011/03/22/nuneaton-ms-sufferer-angry-at-ban-on-cannabis-treatment-92746-28381953/?plckFindCommentKey=CommentKey%3A68f5c4f1-d509-4608-a89a-7018c94f71ae
Will open in: Same window
Relation: nofollow external
This link behaves for me in the following ways:
With JS on:
Middle click: new background tab
R-click, new tab: new background tab
Ctrl-click: new foreground tab (not expected)
Left click: new foreground tab (as expected, but ignores the properties of the link)

With JS off:
Middle click: new background tab
R-click, new tab: new background tab
Ctrl-click: new background tab
Left click: Same tab (as expected)

It is that ctrl-click with JS enabled that is the problem. I don't like workarounds at the best of times, but in this case I am using a laptop and so I don't actually have a middle button - I have to press left and right at once to simulate the middle button. So whilst I could work around the issue by middle-clicking, ctrl-left click is much easier to consistently press correctly than both the mouse buttons at once.

Can anyone give me any pointers as to how I can hack this behaviour back into line? The site has some stunningly annoying mouse-over shit (why do people think it is OK to pop-open menus just when a pointer passes by something? Mice have buttons for a reason!) and I have used AdBlock to make the browser not download a script that enables that particularly annoying behaviour. That is a crude hack, but it works.


BTW, are there plans to fix NoScript's broken menus? I guess they are broken as they behave like no other menu in any UI I have ever used on any computing system, ever, and they used to work just like all the rest of the menus on my computer. What I am particularly impressed with is how the menu changes size and shape, yet the menu acts like it hasn't. So the menu items stop honouring the location of the mouse pointer! If you click on the menu and it changes shape, where the point of the pointer is it will not select what is under the pointer, but what was under the pointer before it changed shape. Is this seriously by design?


[1] Which I pretty much have to, as the functionality of the site is slightly worse with JS disabled than when enabled. Or at least, the annoying shit JS enables is less annoying than a largely broken site (which used to work better before they "upgraded" their site software. Well, there's another choice, fuck off this web 2.0 nonsense and go back to usenet for discussions. There you only have to put up with top-posting idiots who are unable to turn off HTML! And the vast quantities of spam and the fact that most usenet users have abandoned it for the web :(
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.17) Gecko/20110302 SeaMonkey/2.0.12
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Javascript making browser ignore new tab settings

Post by therube »

SeaMonkey 2.0.13, no extensions (so no NoScript).

Tabbed Browsing:
* Switch to new tabs -> unchecked
* Link open -> A new tab in current window
* Links from other -> A new tab in current window

With no NoScript:
Middle click: new background tab
R-click, new tab: new background tab
Ctrl-click: new foreground tab
Left click: new foreground tab

Now adding NoScript into the mix.

With NoScript, uk420 not allowed:
Middle click: new background tab
R-click, new tab: new background tab
Ctrl-click: new background tab
Left click: Same tab

With NoScript, uk420 Allowed:
Middle click: new background tab
R-click, new tab: new background tab
Ctrl-click: new foreground tab
Left click: new foreground tab

So what I am seeing, with uk420 Allowed, is the same as what happens if NoScript is not installed.
Behavior changes with NoScript installed & uk420 not allowed.

I get the same behavior in FF 3.5.16 (both it & SeaMonkey 2.0.x are Gecko 1.9.1).
And same results with SeaMonkey 2.1 & NoScript.


Whether a surrogate or ... ?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; rv:2.0b13pre) Gecko/20110305 Firefox/4.0b13pre SeaMonkey/2.1b3pre
Post Reply