Open CeruleanSky opened 2 years ago
The following configuration is able to work around the GitHub repository Go to file finder issue.
This NoScript Classic Firefox extension Script Surrogate creates a surrogate for the missing Element.replaceChildren() method before the HTML parsing starts:
noscript.surrogate.githubFind.sources
> @https://github.com/*
noscript.surrogate.githubFind.replacement
> (function (item) { if (!item.replaceChildren) { item.replaceChildren = function () { var parentNode = this; var oldNodes = [].slice.call(parentNode.childNodes); var newNodes = [].slice.call(arguments); oldNodes.forEach(function (nodes) { if (!newNodes.find(function(el){ return el === nodes})) { parentNode.removeChild(nodes) } }); parentNode.append.apply(this,newNodes); } } })(HTMLElement.prototype);
Several websites use the ParentNode#Replace feature when filtering items while typing, including this website, GitHub itself
To Reproduce Steps to reproduce the behavior:
this.replaceChildren is not a function
in the consoleExpected behavior Files to pop up
Screenshots (click to expand)
![image](https://user-images.githubusercontent.com/2829875/140657822-60878a65-7745-43ac-86cf-9210a4f5e954.png) ![image](https://user-images.githubusercontent.com/2829875/140657911-a8dc2e84-fb6c-42ba-9fd4-2b2a018b8a1b.png)Desktop: Waterfox Classic 2021.10 any OS
Additional context Waterfox Commit implementing this feature https://github.com/WaterfoxCo/Waterfox/commit/3cb405965c7e6cfa9864f242da40e328f2be89d4
Polyfill: https://github.com/XboxYan/dom-polyfill
Alt Polyfill: https://github.com/yuzhe-han/ParentNode-replaceChildren