Open
Description
Probably we should use some comments nodes for this
One of developer reported, that this code fixed problems with google translate in v2 (worth checking):
export const fix = () => {
if (typeof Node !== "function" || !Node.prototype) {
return;
}
const originalRemoveChild = Node.prototype.removeChild;
const originalInsertBefore = Node.prototype.insertBefore;
// @ts-expect-error
Node.prototype.removeChild = function (child, ...rest) {
if (child.parentNode !== this) {
return child;
}
return originalRemoveChild.apply(this, [child, ...rest]);
};
// @ts-expect-error
Node.prototype.insertBefore = function (newNode, referenceNode, ...rest) {
if (referenceNode && referenceNode.parentNode !== this) {
return newNode;
}
return originalInsertBefore.apply(this, [
newNode,
referenceNode,
...rest,
]);
};
};
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog