pervent part of script?

General discussion about the NoScript extension for Firefox
Post Reply
forecehh
Posts: 18
Joined: Thu Jul 25, 2013 5:10 pm

pervent part of script?

Post by forecehh » Sat Mar 08, 2014 4:09 pm

Hi
can no script prevent part of script?
example in the below site when i allow script it can detect my "Screen Width x Height - Color Depth"
is there anyway prevent that part of script when allow script?
http://www.mdgx.com/bpr.htm

thankyou
Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0

barbaz
Senior Member
Posts: 9230
Joined: Sat Aug 03, 2013 5:45 pm

Re: pervent part of script?

Post by barbaz » Sat Mar 08, 2014 5:08 pm

Generally, you can't block only part of a script, but in your specific example, what you want is possible. Use this surrogate

Code: Select all

noscript.surrogate.preventscreenaccess.replacement : Object.defineProperty(window, "screen", {set:function(){}});
noscript.surrogate.preventscreenaccess.sources : @^https?://
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24

forecehh
Posts: 18
Joined: Thu Jul 25, 2013 5:10 pm

Re: pervent part of script?

Post by forecehh » Sat Mar 08, 2014 9:43 pm

barbaz wrote:Generally, you can't block only part of a script, but in your specific example, what you want is possible. Use this surrogate

Code: Select all

noscript.surrogate.preventscreenaccess.replacement : Object.defineProperty(window, "screen", {set:function(){}});
noscript.surrogate.preventscreenaccess.sources : @^https?://


thank you very much barbaz work fine :D

also what is it surrogate for this option?
Window Width x Height

edit:also it would be great if yo provide surrogate for these options

Code: Select all

JavaScript Version
Local Date + Time
UTC Date + Time
Locale Date + Time
UTC Time Zone Offset
Web Browser Name
Web Browser Code
DNT (Do Not Track) API object
Page Title
Web Browser Version   
CSS Support   
DHTML Support   
XML + AJAX Support   
Canvas Support   
WebGL Support


edit2:also how this website http://detectmybrowser.com/ detect screen resolution and browser window without javascript allowed?
Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0

barbaz
Senior Member
Posts: 9230
Joined: Sat Aug 03, 2013 5:45 pm

Re: pervent part of script?

Post by barbaz » Tue Mar 11, 2014 2:48 am

forecehh wrote:also what is it surrogate for this option?
Window Width x Height

Not really blockable, sorry.

Regarding the other things, why do you want to block all those? The only potentially sensitive information you listed involves your local time, and that doesn't seem fully blockable.
As for the rest... not really a good idea to block those things with surrogates. They are either simple feature detection, or information that's already sent to the server when requesting the webpage.
If you're interested in custom surrogate scripts, you might want to read the docs on Mozilla Developer Network so you know how to write them.

forecehh wrote:edit2:also how this website http://detectmybrowser.com/ detect screen resolution and browser window without javascript allowed?

They don't. They just display 1024x768 as a placeholder until you allow JavaScript.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24

Post Reply