Skip to content

No CORS support #2

Closed
Closed

Description

@aandroyd

If the stylesheet is loaded with @import from another domain, Chrome 64+ hits a CORS error:
Uncaught DOMException: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules...

Activity

  1. samthor commented on Feb 14, 2020

    @samthor
    Owner

    I've just published 0.2.0 which makes this work. If we get a SecurityError reading/modifying imported CSS, we go and fetch it.

    It's not perfect:

    • it will create memory leaks (as it uses URL.createObjectURL and does not revoke them)
    • it means loading CSS on page startup isn't synchronous (you might see a flash as CSS arrives later)
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