Skip to content

Commit

Permalink
See #470
Browse files Browse the repository at this point in the history
fix: added try-catch to avoid error on old Chrome
  • Loading branch information
cure53 committed Sep 18, 2020
1 parent ce22c8c commit 95b7ad2
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 11 deletions.
5 changes: 4 additions & 1 deletion dist/purify.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.cjs.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion dist/purify.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.es.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion dist/purify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ function createDOMPurify(window = getGlobal()) {
} = document;
const { importNode } = originalDocument;

const documentMode = clone(document).documentMode
? document.documentMode
: {};
let documentMode = {};
try {
documentMode = clone(document).documentMode ? document.documentMode : {};
} catch (_) {}

let hooks = {};

Expand Down

0 comments on commit 95b7ad2

Please sign in to comment.