document.scrollingElement icon indicating copy to clipboard operation
document.scrollingElement copied to clipboard

Make safe to include and run in a node environment

Open nathanhammond opened this issue 10 years ago • 2 comments

Check to see if document exists before trying to install the polyfill. This makes it safe to run in a node environment and blindly include in a build for "isomorphic" projects.

nathanhammond avatar Aug 31 '15 18:08 nathanhammond

I’m confused. Wouldn’t this still throw ReferenceError: document is not defined?

mathiasbynens avatar Aug 31 '15 18:08 mathiasbynens

Totally right. I should think and code at the same time. :) Once more unto the breach, this time with feeling. (Redid the PR.)

nathanhammond avatar Sep 01 '15 02:09 nathanhammond