Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for detecting private mode. #2199

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

Feature Request: Support for detecting private mode. #2199

piyushsoni opened this issue Jun 15, 2015 · 9 comments
Milestone

Comments

@piyushsoni
Copy link

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
Copy link
Author

@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!

@janekptacijarabaci
Copy link
Contributor

You can use this temporary solution:
https://gist.github.com/cou929/7973956
See also: https://bugzilla.mozilla.org/show_bug.cgi?id=781982

@piyushsoni
Copy link
Author

@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
Copy link

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
Copy link
Contributor

FYI

Tampermonkey:

  • GM_info.isIncognito
  • The "Store data in incognito mode" setting. The available options are "temporary" and "permanent".

@janekptacijarabaci
Copy link
Contributor

  • GM_info.isIncognito/isPrivate

@arantius arantius added this to the 3.8 milestone Apr 18, 2016
arantius added a commit to arantius/greasemonkey that referenced this issue Apr 18, 2016
Scripts are never private or not, windows are.

Refs greasemonkey#2199
@arantius
Copy link
Collaborator

Feature merged.

@arantius
Copy link
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
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants