Skip to content

Persist pruned styles in LocalStorage #7

@sliminality

Description

@sliminality

After pruning, the resulting stylesheets should be cached somehow in LocalStorage.

PROBLEM: Coming up with a unique and workable key for each stylesheet is hard.

  • StyleSheetId is not persistent
  • Most CSSStyleSheetHeader info isn't uniquely identifying
     // this gives 'regular::false:0:0:undefined' for everything, basically
     `${origin}:${sourceURL}:${isInline}:${startLine}:${startColumn}:${length}` 
  • Can't rely on sourceURL because of increasing popularity of inline styles

https://developer.mozilla.org/en-US/docs/Web/API/Storage/LocalStorage

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions