0

I sometimes get messages such as the following from newspapers' web sites (Washington Post and New York Times):

We noticed you’re browsing in private mode. Private browsing is permitted exclusively for our subscribers. Turn off private browsing to keep reading this story, or subscribe to use this feature, plus get unlimited digital access.

Actually, I am a subscriber to both of these papers, but I'm not paying a subscription for the privilege of being tracked. Ironically, non-subscribers can hit the page and read (in non-private mode), so in a sense they get treated better than subscribers. (The can read anonymously, although they get tracked.)

How do these web sites know that I'm in private mode? It doesn't seem to have anything to do with cookies. (Disallowing cookies but visiting the site in non-private mode doesn't cause the problem.)

Strangely, these sites work fine in a text-based browser such as lynx with cookies disallowed. I suppose the blocking is done is javascript, which lynx doesn't execute.

  • I googled your question and this came up as an answer: https://security.stackexchange.com/questions/9037/can-web-sites-detect-whether-you-are-using-private-browsing-mode It is also in the Related list on the side of your question. – schroeder Jun 11 '19 at 12:13
  • 1
    Being a subscriber is antithetical to browsing anonymously. They can’t provide you with “subscriber benefits” unless they are permitted to identify you and validate your subscription. Have you considered running ghostery or noscript to remove most of the trackers? – John Deters Jun 11 '19 at 12:36
  • I looked at the referenced *duplicate* answer and it does not adequately justify detection with current browsers. For example, Firefox on Linux will not play NetFlix movies in private browsing mode, yet it works fine in normal mode with all the same settings. I believe it's related to local storage mode capabilities but am not sure. – user10216038 Jun 11 '19 at 17:45
  • @user10216038 this has been covered in a variety of ways over the years: https://stackoverflow.com/questions/2860879/detecting-if-a-browser-is-using-private-browsing-mode – schroeder Jun 11 '19 at 20:28
  • @schroeder - thanks, but none of the methods described in that reference apply in my example of NetFlix. They are doing something entirely different. I believe it's based upon HTML 5 local storage. It is definitely _not_ CSS visited because I have a clean cache in both intances. – user10216038 Jun 11 '19 at 21:45
  • @schroeder - Here you go: https://gist.github.com/jherax/a81c8c132d09cc354a0e2cb911841ff1 ...... function isPrivateMode() { return new Promise((resolve) => { const yes = () => resolve(true); // is in private mode const not = () => resolve(false); // not in private mode const **testLocalStorage** = () => { try { if (localStorage.length) not(); else { localStorage.x = 1; localStorage.removeItem('x'); not(); } } catch (e) – user10216038 Jun 11 '19 at 21:57
  • So while the question was asked years before, the old answer is no longer completely valid. The advent of HTML 5 creates new mechanisms not previously available. – user10216038 Jun 11 '19 at 22:06
  • @user10216038 I understand, that is just one approach. To ask the question again is not the way to move forward. Instead, the existing answers need to be enhanced, either here or on the other Stacks. – schroeder Jun 12 '19 at 07:34

0 Answers0