Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Custom Rules with WebExtensions #10822

Closed
Closed

Description

@kjorand

Hi,
According to this site it is now possible to add custom rules to Google Chrome by just editing a few lines of it's code, but doing so we corrupt the app which Chrome doen't seem to appreciate it.
Could it be possible to apply the trick descibed above directly in the code of the extension (no corruption, no disparition on update)?
Then we would just have to edit

C:\Users\****\AppData\Local\Google\Chrome\User Data\Default\Extensions\gcbommkclmclpchllfjekcdonpmejbdp\2017.6.20_0\rules\custom.rulesets

Working a lot with local devices (192.168.1.XXX), some of them having to be served over https, others not ... it would be much easier and much less of a pain in the ass ;-)

Additionnally, some websites like Doodle do work with https everywhere on but not with the block unencrypted content option ...

So thinking a little more long term, it'd be great to be able directly from the menu to:

  • remember exclusion of the current site (with an openning field to edit the filter: to choose if the whole domain or the current subdomain or current page ?)
  • remember the deactivation of the blocking option site to site just as for the activation of https everywhere itself

Thank you for that great app!
There are a few of them on the market, but that one is currently the only one I trust (even though it's a little boring having to activate/deactivate it every two minutes when switching tabs .... )

Activity

  1. jeremyn commented on Jul 1, 2017

    @jeremyn
    Contributor

    I'm not entirely sure what you're asking for, but Firefox lets you use complete custom ruleset files as described in https://www.eff.org/https-everywhere/rulesets#testing, by putting the files into a special directory. Chrome has a limited ability to add custom rules using the extension GUI with Add a rule for this site.

    With the coming requirement for add-ons to use WebExtensions instead of XUL/XPCOM as for Firefox 57, the existing Firefox code will be replaced with something like the Chrome code. It's not clear yet to me how custom ruleset files will be supported going forward.

  2. gopherit commented on Jul 10, 2017

    @gopherit
    Contributor

    With the coming requirement for add-ons to use WebExtensions instead of XUL/XPCOM as for Firefox 57, the existing Firefox code will be replaced with something like the Chrome code. It's not clear yet to me how custom ruleset files will be supported going forward.

    I use the custom rules directory in Firefox for all of my development and testing purposes before I even think of submitting a PR. I'd hate to see that functionality disappear.

    I barely use Chrome, but I've found the Chrome add-on to have less functionality than the FF one. It's just "different."

  3. J0WI commented on Aug 9, 2017

    @J0WI
    Contributor

    I'm not sure if this dupes something that is going to change for the Firefox Webextension release.

  4. jeremyn commented on Aug 10, 2017

    @jeremyn
    Contributor

    @gopherit I also use the custom rules directory, for HTTPS Everywhere maintenance. I asked @Hainish about plans to add this to the WebExtensions version, and he responded in #9958 (comment) and following with a (IMHO) tedious and complex workaround. It involves preprocessing the ruleset on the command line and then including the processed ruleset in a JavaScript snippet in the debug console.

    This approach is not a good substitute for the existing functionality, but I don't know how pressed @Hainish is for time on getting the WebExtensions add-on finished for general users. I don't know how to prioritize this critical problem for the twenty or so very important users who are maintainers and regular contributors, vs getting the basic stuff done for the million general users.

    @Hainish Can you weigh in here please?

  5. Hainish commented on Aug 10, 2017

    @Hainish
    Member

    @jeremyn

    Do you have a suggested path forward?

  6. mgol commented on Aug 10, 2017

    @mgol

    @Hainish I feel what's deeply needed here - and that applies to both Chrome & Firefox versions - is to have a settings UI with an editable list of rules. At the basic level even a textarea with rules in a custom DSL would be a big improvement to the current state of things. Some extensions already have something like that, see e.g. uBlock Origin's rule list (the "My filters" tab in the add-on's options).

  7. Hainish commented on Aug 10, 2017

    @Hainish
    Member

    @koops HTTPSEverywhereUserRules are being stored via the storage API (not localStorage) as of #11800, as an array under the key legacy_custom_rulesets.

  8. Hainish commented on Aug 10, 2017

    @Hainish
    Member

    This is only after a migration is performed, though, which can only be done in Embedded WebExtensions.

  9. jeremyn commented on Aug 11, 2017

    @jeremyn
    Contributor

    @Hainish: @mgol and @koops76 have the solution: an in-extension UI where you can edit rules. The key is that we can insert, modify, and persist rulesets which look like normal (not compacted) rulesets, using some kind of text editor.

  10. 11 remaining items

  11. Hainish commented on Aug 30, 2017

    @Hainish
    Member

    An XML editor is highly useful for our ruleset maintainers, thus it's a high priority for me. After #12270 this is my next todo.

  12. J0WI commented on Aug 30, 2017

    @J0WI
    Contributor

    I'm a bit scarred that this will blow the extension up. Aren't there already some tools included in browsers?

  13. Hainish commented on Aug 31, 2017

    @Hainish
    Member

    I literally mean a textarea to enter XML into. I don't want to include a full code editor, that's for sure.

  14. Hainish commented on Aug 31, 2017

    @Hainish
    Member

    This will increase the size of the extension dramatically for something literally only devs will use.

  15. Hainish commented on Aug 31, 2017

    @Hainish
    Member

    It also seems to me, from the workflow @jeremyn describes, that it's not really necessary. You should be able to compose the XML somewhere else and paste it in pretty easily.

  16. J0WI commented on Aug 31, 2017

    @J0WI
    Contributor

    You may have a look at the about:debugging feature of Firefox. I was not able to locate the rulesets, but I think that's the best way to do live editing. I might get improved by upstream bugs.
    Firefox uses CodeMirror anyway for its DevTools.

  17. Hainish commented on Aug 31, 2017

    @Hainish
    Member

    @J0WI for some reason the Embedded WebExtensions version does not allow you to access background frame globals. This is not the case with the full WebExtensions version.

  18. Hainish commented on Oct 25, 2017

    @Hainish
    Member

    Merged in #12863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions