Thegreatsuspender: Add wildcard / regex support to whitelist

Created on 16 May 2015  路  10Comments  路  Source: greatsuspender/thegreatsuspender

From an email request:

I recently started using The Great Suspender, it's definitely living up to its name. The one feature that I would really like to see is for the whitelist to use wildcards instead of... whatever it does now. I don't understand words enough to state the difference. But, it would be really great to whitelist a parent domain without also whitelisting the subdomains.

For example, a big use I have for it is on my million reddit tabs that I open as I browse the front page and will get to later, but I'd prefer not to suspend my "reddit.com" page and have to refresh it. So, if the sub pages were whitelisted with _reddit.com_ instead it wouldn't be a problem.

released

Most helpful comment

Dan, thanks, I was clicking it and nothing happened!

Here's the example, for websearchers coming here:

Add the URL of each page you want to whitelist on a new line. For example:

https://play.google.com/music/listen
https://mail.google.com

You can specify part of the url instead to whitelist multiple sites in one go:

google.com

You can also specify regular expressions by enclosing the text in forward slashes:

/^https:.*google.com/

All 10 comments

A workaround to this would be to take advantage of the 'dont suspend for now' option.
If you click this on your main reddit.com page, it will stop it from suspending automatically. All your other reddit pages will continue to suspend as normal.
The whitelist currently works as a simple string match - so adding reddit.com will whitelist ALL reddit subdomains as you have found.
I can see a use for adding in more complex whitelisting functionality, but am not sure it's worth the extra complexity as long as there are good workarounds.
Happy to hear other use-cases for this though..

It seems a little bizarre that simple wildcards haven't made it into the extension.

As a minimum level of support, I would expect the following to pass a whitelist check:

  • *.example.com - Where the * is a subdomain.
  • example.* - where the * is a TLD.

    • example.com

    • example.co.uk

  • example.com/section/* - Where the * is a part of the site that is not

    • example.com/section/foo

    • example.com/section/bar

Related to suggestion at the end of issue #106

+1
Maybe instead of the indexOf, do something like @DanAtkinson described (e.g. like this) if there are * in it, and full RegExp if it contains anything from .*, +, [, ] and successfully parses as one.

As seen by the above, I finally snapped and decided to look at resolving this issue. It's a single line fix, replacing out url.indexOf(word) >= 0 for RegExp(word).test(url) which returns a boolean.

OK. I have now implemented this in the latest gitHub version. Would be great if someone could test it out. To prevent existing whitelisted entries from being evaluated as regular expressions, I require all regex entries to be enclosed in forward slashes. ie: /^https:.*google.com/
Anything without a leading and trailing slash will be evaluated as a substring.

This feature is now live on the chrome webstore (v6.21).

To update you will need to uninstall and then reinstall the extension.
IMPORTANT: Before uninstalling, make sure you unsuspend all currently suspended tabs. Also, this will delete your whitelist and any saved sessions you have created, so you will need to export these before you update.

This feature needs documented examples. For example, would this whitelist *.google.com ? /^https:.*google.com/

I think that httrack has the best url whitelisting/blacklisting feature, imho. httrack is a downloading webcrawler with gui versions too.

@justingoldberg Hover over the question mark icon.

Dan, thanks, I was clicking it and nothing happened!

Here's the example, for websearchers coming here:

Add the URL of each page you want to whitelist on a new line. For example:

https://play.google.com/music/listen
https://mail.google.com

You can specify part of the url instead to whitelist multiple sites in one go:

google.com

You can also specify regular expressions by enclosing the text in forward slashes:

/^https:.*google.com/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elig0n picture elig0n  路  4Comments

AlphaWong picture AlphaWong  路  5Comments

togakangaroo picture togakangaroo  路  4Comments

jimlynch22 picture jimlynch22  路  4Comments

lookfirst picture lookfirst  路  3Comments