9

I am using Google Chrome on Windows 7. I've installed HTTPS Everywhere extension and I want to add my own custom rule.

According to this document it should be stored in a HTTPSEverywhereUserRules directory somewhere on my disk. Unfortunately I cannot find it.

Do you have any idea where to look?

2 Answers 2

5

Rules defined through the user interface are added in to the extension's local storage: Local Storage/chrome-extension_gcbommkclmclpchllfjekcdonpmejbdp_0.localstorage in your Chrome profile directory¹. This is an SQLite database, if you care to edit it manually.

You can also define rules manually (thanks to MCL for the tip). Current versions of Chrome refuse to load an extension if it's been modified, so you need to either make a copy of the extension outside of the Chrome profile directory or update Chrome's stored signature after modifying the extension.

Either way, go to the extension's directory, which is Extensions/gcbommkclmclpchllfjekcdonpmejbdp/2014.9.11_0 in the Chrome profile directory¹ (replace 2014.9.11_0 by the version you have installed). If you choose to update the signature, you'll need to modify the files _metadata/computed_hashes.json and _metadata/verified_contents.json; I don't know what exactly you need to update or how. If you choose to make a copy, copy the gcbommkclmclpchllfjekcdonpmejbdp directory outside of your profile, uninstall the extension, and drag-and-drop the directory containing the outside copy onto the Extensions page in Chrome.

In the extension directory, there is a file called rules_list.js containing a reference to the default ruleset library. Add yours:

var rule_list = [
"rules/default.rulesets",
"rules/personal.rulesets",
];

Create a file called personal.rulesets in the rules subdirectory. From then on, to modify rules, edit that file. The content of this file should be something like this:

<rulesetlibrary>
<ruleset name="Example ruleset">
  <target host="*.example.com" />
  <target host="*.example.net" />
  <rule from="http:" to="https:" />
</ruleset>
</rulesetlibrary>

Each ruleset can be enabled or disabled independently through the user interface.

To make HTTPS Everywhere reload your rules, go to the Tools → Extensions page. Untick the “Enabled” box next to “HTTPS Everywhere”, and tick it back.

Click on “background page” in the “HTTPS Everywhere” block, and select the “Console” tab. If you see an error message in red, there was an error in your rules; fix it and try again. Otherwise your rules are working.

¹ The default Chrome profile directory is located at %LOCALAPPDATA%\Google\Chrome\User Data\Default under Windows and ~/.config/google-chrome/Default under Linux

5
  • Uupon making the change to extension files, newer versions of Chrome (mine is 41) disable the extension with a message -- "“This extension may have been corrupted" and provide a Repair option to download/ install it afresh (support.google.com/chrome_webstore/answer/187443?hl=en).
    – Anand Bhat
    Apr 2, 2015 at 4:35
  • @andy Yes, Google has added another layer of annoyance. You need to move the extension outside the Chrome directory and install it from there. I've updated the answer, thanks for reminding me. Apr 2, 2015 at 11:46
  • Is there any way to add custom rules through some graphic interface, something similar to <chrome://net-internals/#hsts>? Apr 8, 2017 at 5:38
  • @FranklinYu Yes, there is. Click on the button for this extension. The point of this question was what happens below that interface. Apr 8, 2017 at 11:14
  • @Gilles Thank you. I didn't notice that the link to add custom rules only appears in HTTPS pages, so I need to create the rule on target site instead of source site (which actually makes sense). By the way, is there any way to list (index) all the custom rules added by that "add custom rule" link? And even to change/delete some rules? Apr 9, 2017 at 6:20
2
  • In your OS, go to the folder where the HTTPS Everywhere extension was installed. On Windows, that's
    %LOCALAPPDATA%\Google\Chrome\User Data\Default\Extensions\gcbommkclmclpchllfjekcdonpmejbdp\VERSION
    (replace VERSION, of course).
  • Put the XML file(s) in the rules subfolder.
  • Edit rule_list.js and add the new file(s) to the list, like this (THEFILE.xml is the new ruleset):

    var rule_list = ["rules/default.rulesets","rules/THEFILE.xml"];

  • Restart Chrome.

Copied from here and slightly altered.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .