2020-08-01 03:43:15 +02:00
|
|
|
|
"use strict";
|
|
|
|
|
|
2020-02-28 23:59:07 +01:00
|
|
|
|
/* 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);
|
|
|
|
|
};
|