Page 1 of 1

pervent part of script?

Posted: Sat Mar 08, 2014 4:09 pm
by forecehh
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

Re: pervent part of script?

Posted: Sat Mar 08, 2014 5:08 pm
by barbaz
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?://

Re: pervent part of script?

Posted: Sat Mar 08, 2014 9:43 pm
by forecehh
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?

Re: pervent part of script?

Posted: Tue Mar 11, 2014 2:48 am
by barbaz
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.