Skip to content

Commit

Permalink
fix: Adding flag support for Microsoft Edge, Low performance but at l…
Browse files Browse the repository at this point in the history
…east it

works now 💩
  • Loading branch information
eavichay committed Nov 10, 2017
1 parent b613549 commit 0cc7fc3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Slim.es6.js

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions Slim.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons

var __flags = {
isWCSupported: 'customElements' in window && 'import' in document.createElement('link') && 'content' in document.createElement('template'),
isIE11: !!window['MSInputMethodContext'] && !!document['documentMode']
isIE11: !!window['MSInputMethodContext'] && !!document['documentMode'],
isChrome: undefined,
isEdge: undefined
};

try {
__flags.isChrome = /Chrome/.test(navigator.userAgent);
} catch (err) {
__flags.isChrome = false;
}
__flags.isEdge = /Edge/.test(navigator.userAgent);

if (__flags.isIE11 || __flags.isEdge) {
__flags.isChrome = false;
Object.defineProperty(Node.prototype, 'children', function () {
return this.childNodes;
});
}
} catch (err) {}

var _$2 = '_slim_internals_'; //Symbol('Slim')

Expand Down
Loading

0 comments on commit 0cc7fc3

Please sign in to comment.