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.

In-extension ruleset XML editor #11794

Closed
Closed

Description

We could use CodeMirror.

Activity

  1. added this to the wishlist milestone on Aug 10, 2017
  2. jeremyn commented on Aug 10, 2017

    @jeremyn
    Contributor

    FYI, but as far as I know, the rulesets are stored in the extension itself in a compacted/modified form (see #9958 (comment)). So, they are not available to edit within the extension itself the way that you see them on GitHub or the Atlas.

    On the other hand this could be part of good alternative to the soon to be deprecated HTTPSEverywhereUserRules/ subdirectory (issue #10822 and elsewhere).

  3. gloomy-ghost commented on Nov 6, 2017

    @gloomy-ghost
    Collaborator

    Does #12863 fulfill this?

  4. jeremyn commented on Nov 6, 2017

    @jeremyn
    Contributor

    This issue seems technically resolved by #12863, which does introduce an XML ruleset editor in the extension. I guess though that @koops76 wants more robust XML highlighting, which is reasonable.

    There must be some compromise solution between nothing and something as full-featured as CodeMirror. In #12863 (comment) I asked @Hainish for some guidelines but so far he hasn't responded to that request:

    • We should have some kind of XML highlighting. I know we talked about this before in In-extension ruleset XML editor #11794. CodeMirror is probably too heavyweight but there appear to be many options for small JS/browser-based syntax highlighters. I can try to find something if you can give me some requirements, e.g. must be 10kB or less in size etc.
  5. gloomy-ghost commented on Nov 6, 2017

    @gloomy-ghost
    Collaborator

    50KB sounds ok to me, given that we used to ship megabytes of tests in the ruleset file for years without anyone complaining

  6. Hainish commented on Nov 7, 2017

    @Hainish
    Member

    Is there any reason why this has to be shipped with the release version, and not simply passed as a build flag like --include-debug-xml-highliting?

  7. jeremyn commented on Nov 7, 2017

    @jeremyn
    Contributor

    Building and using an unsigned extension, and using a Firefox build that allows for unsigned extensions, is annoying and requires extra steps.

    It encourages using non-stable versions of Firefox and the extension for testing.

    It would be nice to have highlighting available for contributors who are developing rulesets who don't want to go through these extra steps. We might get more and higher quality rulesets that way.

    Firefox and Chrome have developer tools in their browsers even though most users don't use them. They could save a few bytes by leaving them out, but they don't, I guess for reasons some of which also apply here.

  8. jeremyn commented on Nov 7, 2017

    @jeremyn
    Contributor

    Also as far as I know it's not possible, or at least unsupported, to build the extension on Windows.

    It might also be difficult to build the extension on a system the user doesn't fully control, such as a work/school/library/shared computer.

  9. Hainish commented on Nov 9, 2017

    @Hainish
    Member

    It encourages using non-stable versions of Firefox and the extension for testing.

    The unbranded extensions are not non-stable. They do allow unsigned versions of extensions to be installed, and that's a security risk, but non-stable is something different. Regardless, your point is taken. I think it's fine to add some syntax hilighting as long as it only adds ~50k.

  10. jeremyn commented on Nov 10, 2017

    @jeremyn
    Contributor

    https://github.com/google/code-prettify looks like a good choice. StackOverflow uses it. The minimized, gzipped download at https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js is about 8KB, though of course we should include the code in the project and not use a CDN.

  11. Hainish commented on Nov 10, 2017

    @Hainish
    Member

    @jeremyn is it available for texarea elements as well? Some libraries only support rendered HTML rather than inputs.

  12. jeremyn commented on Nov 10, 2017

    @jeremyn
    Contributor

    Oops, you're right, code-prettify seems to just be for rendered text.

  13. jeremyn commented on Nov 11, 2017

    @jeremyn
    Contributor

    PR #13560 adds CodeMirror support to the ruleset debugger.

  14. jeremyn commented on Dec 5, 2017

    @jeremyn
    Contributor

    I'm closing this issue since CodeMirror has been added to the ruleset debugger.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions