User Tools

Site Tools


docs:tips_n_tricks:browsing_the_internet.html

Internet Annoyances

How to cope with annoyances while browsing the Web …

Recover from navigator.cookieEnabled giving senseless value

If you enable cookies to specific sites only, the javascript method navigator.cookieEnabled will most properly return false, erroneously telling the script cookies won't work.

Found at http://forums.mozillazine.org/viewtopic.php?f=38&t=547857 (found with google), I tried the following solution for firefox which worked for me:

  1. Install the NoScript Plugin
  2. Enter the “about:config” Page
  3. Add the following two properties:
noscript.surrogate.nce.sources = @*.hertz.de
noscript.surrogate.nce.replacement = navigator.__defineGetter__("cookieEnabled",function(){var ed=new Date; ed.setTime(0); var tc="__noscriptTestCookie_"+Math.round((Math.random()*99999)).toString(16)+"=1";document.cookie=tc;var ok=document.cookie.indexOf(tc)>-1;document.cookie=tc+";expires="+ed.toGMTString();return ok});

where *.hertz.de is the site I had troubles with.

docs/tips_n_tricks/browsing_the_internet.html.txt · Last modified: 15.04.2010 23:24 CEST by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki