danielstjules / blankshield

Prevent reverse tabnabbing phishing attacks caused by _blank
http://danielstjules.github.io/blankshield/
MIT License
140 stars 24 forks source link

fix node reference errors with navigator & window #12

Closed albertstill closed 6 years ago

albertstill commented 7 years ago

We had a React server side rendering issue when this module was required, and I noticed the code assumes a browser context on require.

Before: screen shot 2017-11-13 at 3 04 59 pm

After: screen shot 2017-11-13 at 3 23 17 pm

Cheers

danielstjules commented 7 years ago

Quick glance, doesn't this break patch and cause an infinite loop?

albertstill commented 7 years ago

@danielstjules good spot, didn't see the patch function, I've fixed it by lazily caching window.open when patch is called.

danielstjules commented 6 years ago

Fixed in master!