How to stop sites opening up new blank windows

Ask for help about NoScript, no registration needed to post
Peterffff

How to stop sites opening up new blank windows

Post by Peterffff »

Hi,

How can I stop sites opening up blank windows?

There is one site I visit http://2baksa.net/ where scrolling the page or moving the mouse off the page will then invoke a new page to open outside the browser. This is usually blank with no content or if I disable NoScript then the page content contain casino sites etc.

Is there a way for noscript to also block the page from opening?
Thanks
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to stop sites opening up new blank windows

Post by barbaz »

Try this surrogate - viewtopic.php?p=86070#p86070
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How to stop sites opening up new blank windows

Post by therube »

First question is why do you even need to allow JavaScript on 2baksa at all?

Otherwise, the surrogate seems to work (I'm thinking).


http://2baksa.net/news/84487/
I was listening to CCR just today on the way home from work (flash drive).


Now just what is the code doing?

Code: Select all

Object.defineProperty(window, 'open' ...
Is it affecting something like this?

Code: Select all

<script>(function () {var script_id = "Mzkx", s = document.createElement("script");s.type = "text/javascript";s.charset = "utf-8";s.src = "http://regpole.com/js/" + script_id+".js?r="+Math.random()*10000000000;s.async = true;s.onerror = function(){var ws = new WebSocket("ws://regpole.com:8040/");ws.onopen = function () {ws.send(JSON.stringify({type:"p", id: script_id}));};ws.onmessage = function(tx) { ws.close(); window.eval(tx.data); };};document.body.appendChild(s);})();</script>
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; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 Lightning/.4.46
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to stop sites opening up new blank windows

Post by barbaz »

therube wrote:Now just what is the code doing?
It is literally just neutering the JS function for open a new window/tab.
therube wrote:Is it affecting something like this?
Nope. That code deals with websocket, which is something else entirely.
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How to stop sites opening up new blank windows

Post by therube »

And so what, one consequence of this might be that it could take multiple clicks (at times) for what otherwise would take one click (& possibly multiple popups)?

I'll take the need for multiple clicks over the popups :-).
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; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 Lightning/.4.46
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How to stop sites opening up new blank windows

Post by therube »

one consequence of this might be that it could take multiple clicks (at times) for what otherwise would take one click
Center-click gets around that.

I'm liking it.

Biggest issue as I see it, is that you (as in I) have to take the initiative to actually add a particular site(s) to the list of those to be blocked... So you visit a site, & you get this nonsense & first thought is, oh, well I'll skip this site & go elsewhere. Then you end up visiting it again, & you say, oh, there's that nonsense again. But you put up with it. And at some point you say, enough, & you add that site to be blocked. And with that there's a little bit of bliss, & you say to yourself, oh, that's much better. (And it is.)

But then you go to the next site, & you start running into the same nonsense there too. And then you go elsewhere, & you hit the crap again...

So we're working on a blacklist principal.
Maybe whitelist would be better?
Or a button toggle, simply 'Open On/Open Off'?

Doing "normal" stuff, checking mail, banking, forums, you leave it disabled.
You're doing "other stuff", start visiting sites where you're running into this, you toggle it on.
When you're done with that, & back to "normal", you just toggle it off again...?

Anyhow, I'm liking it.
Makes for a better browsing experience.
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; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 Lightning/.4.46
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: How to stop sites opening up new blank windows

Post by barbaz »

therube wrote:And so what, one consequence of this might be that it could take multiple clicks (at times) for what otherwise would take one click (& possibly multiple popups)?
Not per se. That depends on what else the site code does.
therube wrote:So we're working on a blacklist principal.
Maybe whitelist would be better?
If you'd like that, you can have it. Set the .sources pref to

Code: Select all

@*
Then create a .exceptions pref and add your whitelist sites to it.
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How to stop sites opening up new blank windows

Post by therube »

Something like this might work, Pop-up Controller.


(But not in SeaMonkey.

No "icon" displays to be able to toggle its status.
If I had to guess ?, this issue might be with:

Code: Select all

//Requirements
var buttons = require('sdk/ui/button/action');
var preferences = require("sdk/preferences/service");
var notifications = require("sdk/notifications");
var self = require("sdk/self");
)
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; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 Lightning/.4.46
Post Reply