17 votes

Firefox plugin Stylus no longer working on Tildes

I have poor vision and I rely heavily on a Firefox plugin called Stylus to make websites readable - in particular the trend for low contrast and small text. That includes Tildes.

I updated it to v1.5.0 and now the styles I set for Tlldes no longer work - most other sites still appear to work but I've not checked them exhaustively.

I immediately tried rolling back a release or two (1.4.23 and 1.4.22) but those versions no longer work for any site. I tried randomly downgrading to even older versions but the same result. I think I'm stuck with the latest version..

I notice in the browser console there are 2 errors reported on Tildes e.g. on this page I see:

Content Security Policy: The page's settings blocked the loading of a resource at inline ("script-src"). new_topic:1:1
Content Security Policy: The page's settings blocked the loading of a resource at inline ("style-src"). new_topic:1:1

Using the Firefox Developer tools Inspector - I see my style settings for Tildes injected by Styuls (after the body) but they do not work any more.

Since only Tildes so far is not working with my Stylus settings I guess there is also a recent change to Tildes that is causing Stylus to fail.

This is a rather serious issue for me as all the colour options in the setting are low contrast and cause eye strain which becomes painful without the Stylus settings.

Thanks for any help you can offer.

7 comments

  1. [4]
    Emerald_Knight
    (edited )
    Link
    Yeah, I just noticed the sudden breaking of my theme as well. Thought there might have been an update to the base themes that broke it, but nothing works at all. The CSP errors are the only new...

    Yeah, I just noticed the sudden breaking of my theme as well. Thought there might have been an update to the base themes that broke it, but nothing works at all. The CSP errors are the only new thing I noticed.

    Probably a server configuration change, unfortunately.


    Edit: CSP is now the following:

    default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; manifest-src 'self'; form-action 'self'; frame-ancestors 'none'; base-uri 'none'`
    

    This prevents the inline styles being applied by Stylus. Definitely a configuration change.

    8 votes
    1. [3]
      Deimos
      Link Parent
      The CSP hasn't changed significantly since the site launched. This is the file where it's defined: https://gitlab.com/tildes/tildes/blob/master/salt/salt/nginx/tildes.conf.jinja2#L46 And that file...

      The CSP hasn't changed significantly since the site launched. This is the file where it's defined: https://gitlab.com/tildes/tildes/blob/master/salt/salt/nginx/tildes.conf.jinja2#L46

      And that file hasn't been touched since the open-source release over 4 months ago: https://gitlab.com/tildes/tildes/commits/master/salt/salt/nginx/tildes.conf.jinja2

      So there must have been a change in Stylus or Firefox that's changed the behavior so that it no longer works on sites with restrictive CSPs (which Tildes's definitely is, but it always has been).

      11 votes
      1. bhrgunatha
        (edited )
        Link Parent
        Thanks - I'll chase Stylus about the issue - I haven't changed anything else about Firefox only the plugin version. Edit: For anyone else suffering - as a workaround. I transferred all my Stylus...

        Thanks - I'll chase Stylus about the issue - I haven't changed anything else about Firefox only the plugin version.

        Edit: For anyone else suffering - as a workaround.

        I transferred all my Stylus settings for tildes.net to: <FF profile path>/chrome/userContent.css and that method works!

        @-moz-document domain("tildes.net") {
        ...
        CSS rules to override stylesheet
        ...
        }
        
        13 votes
      2. Emerald_Knight
        Link Parent
        That's strange. I'd never even updated Stylus. Thanks for chiming in!

        That's strange. I'd never even updated Stylus.

        Thanks for chiming in!

        5 votes
  2. [3]
    bhrgunatha
    Link
    Update: A fix has been added to Stylus - hopefully the next version works here again.

    Update:
    A fix has been added to Stylus - hopefully the next version works here again.

    7 votes
    1. [2]
      Deimos
      Link Parent
      Nice, that's good. Please let me know if it ends up fixing it or not. Being able to support Stylus styles is important to me, so I'm willing to loosen the CSP if it ends up being necessary (but...

      Nice, that's good. Please let me know if it ends up fixing it or not. Being able to support Stylus styles is important to me, so I'm willing to loosen the CSP if it ends up being necessary (but I'd prefer not to, if they can fix it).

      6 votes
      1. bhrgunatha
        Link Parent
        Good news - Stylus v1.5.1 is working great with tildes once again!

        Good news - Stylus v1.5.1 is working great with tildes once again!

        4 votes