All posts by James

FAQ: Why does LeechBlock require the permissions it asks for?

LeechBlock requires the following browser permissions to be granted by the user at installation:

  1. Access browser tabs
  2. Access browser activity during navigation
  3. Access your data for all websites
  4. Access browsing history
  5. Download files and read and modify the browser’s download history

The first three of these are required so that LeechBlock can check the URL of each page the browser tries to access (in any tab, not just the active tab) to see whether it should be blocked according to the user’s settings. If the user wants to block pages containing specific words or phrases, LeechBlock also needs to access the content of those pages (not just the URL).

The fourth (“Access browsing history”) is needed for the Add blocked page to browser history option.

The fifth (“Download files…”) is used only for the Export Options to File feature (see under General tab in Options). The file is saved using the browser’s download manager.

If the user enters a URL in the Load list of sites from URL field, LeechBlock will ask for additional permission to access external URLs. Most users will not use this feature.

LeechBlock does not send any information to external sites. (This can be confirmed by examining the source code.) All user settings and data are stored locally on the user’s computer (unless the user has chosen to use sync storage; see under General tab in Options). Uninstalling LeechBlock will remove all user settings and data.

FAQ: What does the “Offset time limit period” field do?

By default, the start of any time limit period (i.e., the period within which a time limit applies) will be aligned with midnight (12am) on Sunday. For example:

  • If you set a time limit of 10 minutes in every 6 hours, you will be allowed
    • 10 minutes between 12am and 6am
    • 10 minutes between 6am and 12pm
    • 10 minutes between 12pm and 6pm
    • 10 minutes between 6pm and 12am
  • If you set a time limit of 30 minutes in every 12 hours, you will be allowed
    • 30 minutes between 12am and 12pm
    • 30 minutes between 12pm and 12am
  • If you set a time limit of 60 minutes in every week, you will be allowed
    • 60 minutes between 12am on Sunday and 12am the following Sunday

The Offset time limit period field allows you to adjust this default behavior to suit your own schedule by specifying an offset (positive or negative) in hours. For example:

  • If you specify an offset of 6 hours, the time limit periods will be aligned with 6am on Sunday.
  • If you specify an offset of -3 hours, the time limit periods will be aligned with 9pm on Saturday.
  • If you specify an offset of 24 hours, the time limit periods will be aligned with midnight (12am) on Monday.
  • If you specify an offset of -36 hours, the time limit periods will be aligned with noon (12pm) on Friday.

If in doubt, just leave the offset field blank!

FAQ: How can I hide LeechBlock in Firefox’s Add-ons Manager?

The legacy version of LeechBlock included an option to hide the LeechBlock extension in Firefox’s Add-ons Manager, preventing users from easily disabling or uninstalling it. It’s no longer possible to provide this option due to restrictions on extensions that were introduced in Firefox 57.

However, there is another way to hide LeechBlock in the Add-ons Manager. Carefully follow these steps:

  • Locate your Firefox profile folder.
  • Create a new folder chrome inside your profile folder (if it doesn’t already exist).
  • Create a new file userContent.css inside that folder with the following content: [addon-id='leechblockng@proginosko.com'] { display: none !important; }

You will need to close all Firefox windows and restart Firefox for it to take effect.

Note: If you’re using Firefox 69 or above, you’ll also need to go to about:config and ensure the toolkit.legacyUserProfileCustomizations.stylesheets preference is set to true (go here for more detailed instructions).

FAQ: How can I disable safe (troubleshoot) mode on Firefox?

Here are three ways to prevent access to Firefox’s safe mode (also called “troubleshoot mode”).

1. Set the DisableSafeMode Policy

The most effective and comprehensive way to prevent access to safe mode is to set the DisableSafeMode Firefox policy. (You should create a backup of your LeechBlock settings before you attempt this solution: Options > General > Export.)

On Windows, the policy can be set via the Registry Editor:

  • Navigate to the following registry key:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox
  • Add a new value to that key:
    • Name: DisableSafeMode
    • Type: DWORD (REG_DWORD)
    • Data: 1

Warning: Do not attempt to edit the registry unless you really know what you’re doing! You should back up your registry before making any changes. The developer of LeechBlock will not be held responsible for any damage you do to your system by editing the registry.

For further information on setting Firefox policies on Windows, Mac, and Linux systems, see here.

2. Remove the Help Menu Item

You can use the userChrome browser customization file to remove the “Restart with Add-ons Disabled” or “Troubleshoot Mode” menu item from the Help menus. Carefully follow these steps:

  • Locate your Firefox profile folder.
  • Create a new folder chrome inside your profile folder (if it doesn’t already exist).
  • Create a new file userChrome.css inside that folder with the following content:
    [label^='Restart with Add-ons Disabled'] { display: none !important; }
    [label^='Troubleshoot Mode'] { display: none !important; }

You will need to close all Firefox windows and restart Firefox for it to take effect.

Note: If you’re using Firefox 69 or above, you’ll also need to go to about:config and ensure the toolkit.legacyUserProfileCustomizations.stylesheets preference is set to true (go here for more detailed instructions).

(Credit to Metaception for suggesting this solution.)

If you also want to remove the button from the about:support and about:profiles pages, create another file userContent.css inside the same folder with the following content:

#safe-mode-box { display: none !important; }
#restart-in-safe-mode-button { display: none !important; }

If you also want to remove the “Create a New Profile” button from the about:profiles page, add the following line to userContent.css:

#create-button { display: none !important; }

3. Disable the Safe Mode Key

You can set the environment variable MOZ_DISABLE_SAFE_MODE_KEY (to any value) to prevent starting Firefox in safe mode by holding down the SHIFT key.

If you’re not sure how to set an environment variable, you can find guidance here.

FAQ: It’s all gone horribly wrong. How can I start over with LeechBlock?

LeechBlock for Firefox

Follow these steps to start over with LeechBlock NG:

  • Start Firefox in safe mode.
  • Go to Add-ons (Ctrl+Shift+A) and uninstall the LeechBlock extension.
  • Close all Firefox windows and restart Firefox normally (i.e., without safe mode).
  • Follow the instructions here to install the latest version of LeechBlock.

If you’re still using the legacy version of LeechBlock, you should follow these steps instead:

  • Start Firefox in safe mode.
  • Go to Add-ons (Ctrl+Shift+A) and uninstall the LeechBlock extension.
  • Close all Firefox windows and restart Firefox normally (i.e., without safe mode).
  • Enter about:config into the browser’s location bar.
  • Enter extensions.leechblock into the Filter field.
  • You should see a list of browser preferences displayed. Right-click on each preference in turn and select Reset.
  • Follow the instructions here to install the latest version of LeechBlock.

LeechBlock for Chrome

Follow these steps to start over with LeechBlock NG:

  • Right-click on the LeechBlock button LeechBlock icon and select Remove from Chrome…
  • Click the Remove button in the dialog box to confirm removal.
  • Follow the instructions here to install the latest version of LeechBlock.

FAQ: Can I use wildcards when specifying sites?

Yes. The wildcard character (*) can be used match any number of characters except forward-slashes (e.g., *.com will block all dot-com sites and * on its own will block all sites).

Note that * will also match no characters (e.g., foo*bar.com will block foobar.com).

If you want to match any number of characters including forward-slashes, use a double-wildcard (**).

If you want to match one or more characters, use a wildcard-plus (*+).

FAQ: What’s the difference between “within time periods OR after time limit” and “within time periods AND after time limit”?

This option determines how the time periods condition and the time limit condition are combined and applied.

  • If the OR option is selected, sites will be blocked when either condition is met.
  • If the AND option is selected, sites will be blocked only when both conditions are met.

Here’s an example to illustrate the difference. Suppose you’ve entered 0900-1700 as a time period and 10 minutes in every hour as a time limit.

If you select within time periods OR after time limit then the sites will be blocked entirely between 9am and 5pm and will also be blocked after browsing them for more than 10 minutes in every hour at other times of the day (i.e., before 9am and after 5pm).

If you select within time periods AND after time limit then the sites will be blocked only after browsing them for more than 10 minutes in every hour between 9am and 5pm and will not be blocked at other times of the day (i.e., before 9am and after 5pm).

Note: If you’ve left either the time periods field or the time limit field blank, then you should select within time periods OR after time limit (otherwise the sites will never be blocked).

FAQ: Can I block pages that contain specific words or phrases?

The tilde prefix (~) can be used to restrict blocking to sites that contain given keywords. Within a keyword you can use an asterisk (*) to match any number of characters (except whitespace) and an underscore (_) to match whitespace. Note that the keyword matching is case-insensitive (i.e., uppercase and lowercase are treated as equivalent).

So, for example, you could enter the following into the list of sites:

somesite.com
anothersite.com
~anteaters
~crypto*
~*alicious
~green_eggs_and_ham

This would result in pages on the sites somesite.com and anothersite.com being blocked only when those pages contain the complete word “anteaters” or any word beginning with “crypto” or any word ending with “alicious” or the complete phrase “green eggs and ham”.

If you want to block pages on any website that contain given keywords, you’ll need to use wildcards to specify all websites. For example:

*
~justin_bieber
~kim_kardashian

If you want pages with the specified keywords to be allowed rather than blocked, you should select the option Treat keywords as allow-conditions rather than block-conditions under Advanced Options. Thus, if you were to select that option with the example above, the effect would be to block all pages except those containing “justin bieber” or “kim kardashian” (not something I recommend, just for the record).