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.

9gag.com rule breaks commenting on the site #2657

Closed

Description

@sledgehammer999

I have had this problem for 3-4 months now. Before it was working.
I was really baffled why it didn't work, until I started disabling extensions one-by-one.
Basically I cannot comment on 9gag when https-everywhere is enabled.

I am using firefox 40 on Windows 7.
https-everywhere is 5.1.0

Activity

  1. TheNavigat commented on Aug 27, 2015

    @TheNavigat
    Contributor

    I tried fixing this. The following works, but I can't push it.

    <ruleset name="9gag (partial)">
    
        <target host="9gag.com" />
        <target host="admin.9gag.com" />
        <target host="api.9gag.com" />
        <target host="m.9gag.com" />
        <target host="www.9gag.com" />
        <target host="assets-9gag-lol.9cache.com" />
        <target host="images-cdn.9gag.com" />
    
        <exclusion pattern="^http://(?:m\.|www\.)?9gag\.com/+(?!(?:about|advertise|faq|login|privacy|recover|signup|tos)(?:$|[?/])|favicon\.ico|img/)" />
    
        <securecookie host="^admin\.9gag\.com$" name=".+" />
    
        <rule from="^http://images-cdn\.9gag\.com/"
            to="https://d24w6bsrhbeh9d.cloudfront.net/" />
    
        <rule from="^http://assets-9gag-lol\.9cache\.com/"
            to="https://assets-9gag-lol.9cache.com/" />
    
        <rule from="^http:" to="https:" />
    
    </ruleset>
    

    Apparently it fails because of missing tests, but I can't figure out how to add the tests correctly, they're never counted as valid tests for the exclusion clause. Can someone help with that?

  2. jsha commented on Aug 27, 2015

    @jsha
    Member

    The exclusion pattern is a bit confusing:

    ^http://(?:m\.|www\.)?9gag\.com/+(?!(?:about|advertise|faq|login|privacy|recover|signup|tos)(?:$|[?/])|favicon\.ico|img/)

    The "?!" is a negative lookahead assertion, which meanus "match everything that is not followed by this pattern. But since this is an exclusion pattern, it's saying "rewrite m.9gag.com/about, m.9gag.com/advertise, www.9gag.com/about, etc."

    I generally recommend resolving that double negative by turning exclusion rules into positive rules, i.e. rewrite only those paths. However, since the other paths would then fall through to the default http->https rewrite, that would be incorrect. You'd additionally have to add an explicit rewrite for all the other hosts, and remove the default http->https rewrite.

  3. TheNavigat commented on Aug 28, 2015

    @TheNavigat
    Contributor

    That is a little bit too confusing for me.

    What I understood is that we need to add an explicit rule for each subdomain/page, or to be specific, for all the functioning subdomains as well as the specific pages/directories listed in the exclusion pattern. And then we need to remove the http to https rule (I think you mistakenly wrote remote instead of remove. If you did actually mean "remote", then I'd be grateful if someone could explain that bit as well). Is that correct?

  4. jsha commented on Aug 28, 2015

    @jsha
    Member

    Your understanding is correct. And you're right, I meant "remove." I edited the post to fix it.

  5. TheNavigat commented on Aug 28, 2015

    @TheNavigat
    Contributor

    Here,

    <ruleset name="9gag (partial)">
    
        <target host="9gag.com" />
        <target host="admin.9gag.com" />
        <target host="api.9gag.com" />
        <target host="m.9gag.com" />
        <target host="www.9gag.com" />
        <target host="assets-9gag-lol.9cache.com" />
        <target host="images-cdn.9gag.com" />
    
        <securecookie host="^admin\.9gag\.com$" name=".+" />
    
        <rule from="^http://images-cdn\.9gag\.com/"
            to="https://d24w6bsrhbeh9d.cloudfront.net/" />
    
        <rule from="^http://assets-9gag-lol\.9cache\.com/"
            to="https://assets-9gag-lol.9cache.com/" />
    
        <rule from="^http://assets-9gag-lol\.9cache\.com/"
            to="https://assets-9gag-lol.9cache.com/" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/about"
            to="https://$19gag.com/about" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/advertise"
            to="https://$19gag.com/advertise" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/faq"
            to="https://$19gag.com/faq" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/login"
            to="https://$19gag.com/login" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/privacy"
            to="https://$19gag.com/privacy" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/recover"
            to="https://$19gag.com/recover" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/signup"
            to="https://$19gag.com/signup" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/tos"
            to="https://$19gag.com/tos" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/img"
            to="https://$19gag.com/img" />
    
        <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/favicon.ico"
            to="https://$19gag.com/favicon.ico" />
    
    </ruleset>
    

    I'm quite sure that is incorrect because it doesn't even push, but I'm stuck. Travis reports that error.

    ../src/chrome/content/rules/9gag.xml:54: element rule: Relax-NG validity error : Element rule failed to validate attributes
    Relax-NG validity error : Extra element rule in interleave
    

    Line 54 corresponds to that line.

    <rule from="^http:\/\/(?:m\.|www\.)?9gag\.com\/about"
            to="https://$19gag.com/about" />
    

    I do understand what the error says, but I'm not sure how to fix it.

  6. TheNavigat commented on Aug 30, 2015

    @TheNavigat
    Contributor

    @fuglede Can you please help with that?

  7. fuglede commented on Sep 6, 2015

    @fuglede
    Contributor

    As far as I can see, two things are happening. First of all, the error is caused by the escaped slashes. You want / in place of / throughout.

    Then, for the rules to apply correctly, (?: should be replaced by ( (since otherwise, the subdomain isn't captured).

    By the way, I tested with http://m.9gag.com/privacy which gives a 404. Of course, rewriting a 404 to a https 404 is fine but it suggests that going through the rules might not be a bad idea.

  8. OlleNeiman commented on Nov 5, 2016

    @OlleNeiman

    This still doesn't work, btw.

  9. added a commit that references this issue on Feb 21, 2017
    2ebed3f
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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions