mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
ES and TypeScript modules are strict by default and don’t need this directive. ESLint will remind us to add it to new CommonJS files and remove it from ES and TypeScript modules. Signed-off-by: Anders Kaseorg <anders@zulip.com>
15 lines
482 B
JavaScript
15 lines
482 B
JavaScript
"use strict";
|
||
|
||
/* eslint-env browser */
|
||
|
||
// PhantomJS doesn’t support new DOMParser().parseFromString(…, "text/html").
|
||
var real_parseFromString = DOMParser.prototype.parseFromString;
|
||
DOMParser.prototype.parseFromString = function (string, type) {
|
||
if (type === "text/html") {
|
||
var doc = document.implementation.createHTMLDocument("");
|
||
doc.documentElement.innerHTML = string;
|
||
return doc;
|
||
}
|
||
return real_parseFromString.apply(this, arguments);
|
||
};
|