Closed ssi02014 closed 1 year ago
Thanks again!
I believe the commits back then were mostly needed for MSIE. Since we are phasing out support for MSIE and only support it in the low-frequently maintained 2.x branch, this change for main and 3.x should be fine :sweat_smile:
@cure53 Thanks for explaining the history!
Summary
Hello π, @cure53
I determined that
_isNode
is a function that determines whether the givenobject
argument is aDOM Node
.Can
typeof Node
result inobject
? In my tests,Node
gets "function" as the result of the "typeof" operator.I checked on
safari
,firefox
,Edge
, andChrome
and found that the result of typeof Node isfunction
. (Of course, in Node.js, theundefined
)https://github.com/cure53/DOMPurify/commit/e7448403cd2602b0448b39a8715f52aba443153b Looking at the previous commit history, I think it's because of the code like
typeof Node === 'object'
that doesn't work properly.We simply need to make sure that the result of "typeof Node" is 'function' and that the object is an instance of Node.
After fixing the code, the tests all passed. Please review this pull request to see if it's appropriate. π
Firefox
chrome
safari
Edge
Tasks