preact
preact copied to clipboard
conflict with page translation code(like google translate)
version: 10.10.0
I read through the issues and found these two issues, but still haven't found any solution, the patch will affect other functions of the page and it doesn't seem to take effect.
https://github.com/preactjs/preact/issues/948 https://github.com/preactjs/preact/issues/3078
I tried using this patch,but its not work https://gist.github.com/developit/3e807962630ddbd4977cbd07b597f24f#file-preact-google-translate-patch-js-L54
Is there any solution to this problem so far? I thought about it for a long time without thinking about it. expecting a reply
The official website also has the same problem

My English is limited so I used translation software, I hope you can understand, lol
This patch should work:
var insertBefore = Element.prototype.insertBefore;
Element.prototype.insertBefore = function(node, before) {
if (node instanceof Text && before instanceof HTMLElement && before.localName === 'font') {
return node;
}
return insertBefore.call(this, node, before);
};