mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
remove conditional console
This commit is contained in:
@@ -53,14 +53,13 @@ function defendAgainstGoogleTranslate() {
|
||||
const originalRemoveChild = Node.prototype.removeChild;
|
||||
Node.prototype.removeChild = function (child) {
|
||||
if (child.parentNode !== this) {
|
||||
if (console) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
"[Google Translate Defender] Caught error: cannot remove a child from a different parent",
|
||||
child,
|
||||
this
|
||||
);
|
||||
}
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
"[Google Translate Defender] Caught error: cannot remove a child from a different parent",
|
||||
child,
|
||||
this
|
||||
);
|
||||
|
||||
return child;
|
||||
}
|
||||
return originalRemoveChild.apply(this, arguments);
|
||||
@@ -69,15 +68,14 @@ function defendAgainstGoogleTranslate() {
|
||||
const originalInsertBefore = Node.prototype.insertBefore;
|
||||
Node.prototype.insertBefore = function (newNode, referenceNode) {
|
||||
if (referenceNode && referenceNode.parentNode !== this) {
|
||||
if (console) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
"[Google Translate Defender] Caught error: Cannot insert before a reference node from a different parent",
|
||||
"",
|
||||
referenceNode,
|
||||
this
|
||||
);
|
||||
}
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
"[Google Translate Defender] Caught error: Cannot insert before a reference node from a different parent",
|
||||
"",
|
||||
referenceNode,
|
||||
this
|
||||
);
|
||||
|
||||
return newNode;
|
||||
}
|
||||
return originalInsertBefore.apply(this, arguments);
|
||||
|
||||
Reference in New Issue
Block a user