Fix inconsistent naming formats
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
(function (DOMParser) {
|
||||
'use strict';
|
||||
|
||||
const DOMParser_proto = DOMParser.prototype;
|
||||
const real_parseFromString = DOMParser_proto.parseFromString;
|
||||
const DOMParserPrototype = DOMParser.prototype;
|
||||
const realParseFromString = DOMParserPrototype.parseFromString;
|
||||
|
||||
// Firefox/Opera/IE throw errors on unsupported types
|
||||
try {
|
||||
@@ -24,13 +24,13 @@
|
||||
}
|
||||
} catch (ex) { /* noop */ }
|
||||
|
||||
DOMParser_proto.parseFromString = function (markup, type) {
|
||||
DOMParserPrototype.parseFromString = function (markup, type) {
|
||||
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
|
||||
const doc = document.implementation.createHTMLDocument('');
|
||||
doc.documentElement.innerHTML = markup;
|
||||
return doc;
|
||||
} else {
|
||||
return real_parseFromString.apply(this, arguments);
|
||||
return realParseFromString.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
}(DOMParser));
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
(function (HTMLMediaElement) {
|
||||
'use strict';
|
||||
|
||||
const HTMLMediaElement_proto = HTMLMediaElement.prototype;
|
||||
const real_play = HTMLMediaElement_proto.play;
|
||||
const HTMLMediaElementPrototype = HTMLMediaElement.prototype;
|
||||
const realPlay = HTMLMediaElementPrototype.play;
|
||||
|
||||
HTMLMediaElement_proto.play = function () {
|
||||
HTMLMediaElementPrototype.play = function () {
|
||||
try {
|
||||
const promise = real_play.apply(this, arguments);
|
||||
const promise = realPlay.apply(this, arguments);
|
||||
|
||||
if (typeof promise?.then === 'function') {
|
||||
return promise;
|
||||
|
||||
Reference in New Issue
Block a user