Thegreatsuspender: Blacklist

Created on 25 Jan 2015  Â·  12Comments  Â·  Source: greatsuspender/thegreatsuspender

possible to flip around the functionality and add a blacklist??

I think most webpages behaves really good, except facebook, so I would probably just put facebook on the blacklist and have it suspended every 30 min.

feature prioritised

All 12 comments

@rsunde
great idea. i'll consider this for a future release.

I came to request the same feature so :+1: If you add this feature, please have the blacklist override any URLs in the whitelist.

For example, I would like a whitelist entry for .google.com so it doesn't suspend my Gmail tab, docs/drive tab, or any search results pages. However, I do want to suspend my Google Calendar tab at www.google.com/calendar. Currently I have added multiple google.com URLs to the whitelist to accomplish this task, and the list is growing. Having a single entry on each list would be easier to maintain.

An extended option to this would be to add to the toolbar button menu of "add this site to the blacklist" if it is currently matching to a whitelist entry.

While far from the ideal implementation, the extension now supports (to a certain extent) the ability to blacklist. What I've actually done is support regular expressions in the whitelist. To leverage this for blacklisting you could add the following entry (to blacklist all google sites):
/^((?!google).)*$/

This has the following caveats:

  • Any page that does not contain google will be whitelisted.
  • To blacklist a second domain, it must be included within the same regex (ie. you cannot have a second blacklist entry - doing so will have the effect of whitelisting everything).

I'll leave it up to enterprising gitHub users to contribute their blacklist regexes for others to share from :)

as much as I appreciate the effort, this isnt very optimal, as a programmer
you should strive to make things easy for the user not HARDER...

who has time to go and learn regular expressions?

On Tue, Sep 15, 2015 at 8:02 AM, deanoemcke [email protected]
wrote:

While far from the ideal implementation, the extension now supports (to a
certain extent) the ability to blacklist. What I've actually done is
support regular expressions in the whitelist. To leverage this for
blacklisting you could add the following entry (to blacklist all google
sites):

This has the following caveats:

  • Any page that does not contain google will be whitelisted.
  • To blacklist a second domain, it must be included within the same regex (ie. you cannot have a second blacklist entry - doing so will in effect whitelist everything).

I'll leave it up to enterprising gitHub users to contribute their blacklist regexes for others to share from :)

—
Reply to this email directly or view it on GitHub
https://github.com/deanoemcke/thegreatsuspender/issues/145#issuecomment-140289410
.

I'm aware it's not ideal. And implementing a black list was not my intention with this new feature. But unfortunately implementing a proper black list would take more time than I have right now. I was merely letting users know that there is now a work around for this problem, albeit a complicated one.

I understand, its good to have the possibility, albeit a hack of sorts.

On Tue, Sep 15, 2015 at 2:50 PM, deanoemcke [email protected]
wrote:

I'm aware it's not ideal. And implementing a black list was not my
intention with this new feature. But unfortunately implementing a proper
black list would take more time than I have right now. I was merely letting
users know that there is now a work around for this problem, albeit a
complicated one.

—
Reply to this email directly or view it on GitHub
https://github.com/deanoemcke/thegreatsuspender/issues/145#issuecomment-140378428
.

A blacklist would be great. I only installed this plugin to stop one badly behaving site fro consuming 40GB of memory overnight (Assembla).

Just to reiterate here. While there is no dedicated blacklist, it is possible to blacklist sites using the regular express notation in the whitelist.

I have tested it and it seems to work well. Having the following in your whitelist will whitelist all sites except google and twitter:
/^((?!google|twitter).)*$/

There are two caveats to this:

It can be negated by other whitelist entries (having a second whitelist entry of www.google.com will then cause google to be whitelisted
In the above example, any url with the word google or twitter in it will also be blacklisted. ie: https://www.reddit.com/r/google/ will be blacklisted too.

I'm coming from #492, and can confirm that what you suggested works (in 6.30, Win10). Here are some additions from that discussion... (pro noobtip: it changes my text to italics because of the asterisks, so I'm using "backticks" ``````` around the expressions.)

  • Confirmed the expression has to use a pair of /s on the ends. I'm not sure why that is
  • Confirmed the expression /.*/ can be used to whitelist all, but the list is evaluated simultaneously and will whitelist any match even in the case of a conflict, so there is no effective way to use this at the moment.
  • Confirmed a working blacklist expression is as Dean posted above /^((?!google|twitter).)*$/ with each additional entry separated with a | (it acts like a +). That being said, all items need to go in a single expression, so the following on two lines will not work, because though google is unmatched for whitelisting in the first, it is matched in the second.
    /^((?!google).)*$/
    /^((?!twitter).)*$/

A full on nerd-gasm explanation of this can be found here...
https://stackoverflow.com/questions/406230/regular-expression-to-match-a-line-that-doesnt-contain-a-word

Dean, one quick easy thing I would suggest... put the "blacklist" expression in the (?) help popup at the whitelist.

Thanks for your help!

+1 from me too for native blacklist support. I'll try the negative lookahead regex workaround in the meantime.

Thinking about it a bit though, maybe adding this feature could be as simple as a toggle/checkmark/dropdown to treat the whole list as a black or a whitelist, and users can choose which kind of behavior suits them better. And then changing the suspension logic is almost trivial: Instead of suspension being prevented if there is a single match, suspension can only occur if there is a single match on the list.

@deanoemcke Are you open to pull requests if I were to dive into the codebase and implement the above?

tbh, i'm not sure about this. given the low amount of activity on this issue, i doubt there's much demand for this feature, and i'm reluctant to introduce unnecessary complexity.

if it is only used by a few people, then i think it produces an overall net negative effect on the usability of the extension.

implementation may not be totally straightforward either, as there is a quite a lot of code that references the whitelisting, including the UI of the suspended tab itself.

you're welcome to do a PR, but just beware that I may not merge it sorry :(

Coming from #448, I'd have a need for either the blacklisting or the CPU threshold feature.

Was this page helpful?
0 / 5 - 0 ratings