diff --git a/overviewer_core/data/js_src/util.js b/overviewer_core/data/js_src/util.js index a6869fd..4460b22 100644 --- a/overviewer_core/data/js_src/util.js +++ b/overviewer_core/data/js_src/util.js @@ -33,6 +33,8 @@ overviewer.util = { */ 'initialize': function() { //overviewer.util.initializeClassPrototypes(); + overviewer.util.initializePolyfills(); + document.getElementById('NoJSWarning').remove(); @@ -222,6 +224,21 @@ overviewer.util = { }, + /** Any polyfills needed to improve browser compatibility + */ + 'initializePolyfills': function() { + // From https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove + // IE is missing this + if (!('remove' in Element.prototype)) { + Element.prototype.remove = function() { + if (this.parentNode) { + this.parentNode.removeChild(this); + } + }; + } + + }, + /** * This adds some methods to these classes because Javascript is stupid