Feature Request: Support for detecting private mode. #2199

Closed
piyushsoni opened this Issue Jun 15, 2015 · 9 comments

Projects

None yet

4 participants

@piyushsoni

Referring to issue#2140, I want to request an ability to detect whether we are running the userscript in Private mode.
Use case: I have a few userscript based scheduled Tasks I do which run daily, hourly and some more frequently in the browser (e.g. Search Google for a query every n hours), but the problem is, the current task action depends on the last set GM values. Also, I run all new/non-trustworthy websites in Private mode. Now, when I'm doing this (browsing in private mode) my scheduled pages open up, and since they don't remember the values which were set up in the 'Regular (non-private) mode, try to do the same operation again and again and mess everything up. If only I could detect I'm running in Private mode, I wouldn't run those operations.

In fact, if it raises any security concerns in your opinion, for my purpose I'll be glad to even have a Script level option like 'Don't run in Private Mode' (e.g. Chrome doesn't allow running any extensions in 'Incognito mode' by default, you have to explicitly allow that)

Thanks!

@piyushsoni

@arantius ,
Any comments on this issue? This is a badly missing feature from GM, and is a major pain point for some of my scripts :(.

Thanks!

@piyushsoni

@janekptacijarabaci : Thanks! For now, I'm exploiting this Firefox bug you pointed out where Index DB doesn't work in it, and my little test works! I will still wait for a cleaner fix from GreaseMonkey.

@ccd0
ccd0 commented Nov 14, 2015

I'm a bit confused by this because for me, data stored with GM_setValue is remembered even when in private browsing mode, and I was looking for a way to test whether it was on to avoid inappropriately recording data.

@janekptacijarabaci
Contributor

FYI

Tampermonkey:

  • GM_info.isIncognito
  • The "Store data in incognito mode" setting. The available options are "temporary" and "permanent".
@janekptacijarabaci
Contributor
  • GM_info.isIncognito/isPrivate
@arantius arantius added this to the 3.8 milestone Apr 18, 2016
@arantius arantius added a commit to arantius/greasemonkey that referenced this issue Apr 18, 2016
@arantius arantius Remove `isPrivate` from Script object.
Scripts are never private or not, windows are.

Refs #2199
9025133
@arantius
Collaborator

Feature merged.

@arantius arantius closed this Apr 18, 2016
@arantius
Collaborator

This should be fixed in build 3.8beta3; confirmation would be helpful.

https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/versions/3.8beta3

@piyushsoni

Awesome! Just tried, it works (in 3.8beta3)! Thanks to everyone involved in implementing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment