Skip to content

Activating scroll fails with an exception #1

@argasek

Description

@argasek

Checklist

I'm using version [0.2.2]
My browser is: Chrome 68.0.3440.75

Description

An attempt to scroll fails with the following exception:
jquery-scrollTo.es.js:201 Uncaught DOMException: Failed to execute 'insertRule' on 'CSSStyleSheet': Cannot access StyleSheet to insertRule

This happens on the document.styleSheets[0].insertRule(rule, 0); line:

  insertRule(rule) {
    ...
    if (document.styleSheets && document.styleSheets.length) {
      document.styleSheets[0].insertRule(rule, 0);
    } else {
       ...
    }
  }

It fails, because first CSS stylesheet on my website is loaded from an external CDN, which means it's not accessible, and jquery-scrollTo blindly assumes otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions