userChrome.js
userChrome.js copied to clipboard
ucjsDownloadsManager.uc.js breaks in Firefox 120
The downloads manager window has been changed in Firefox 120, which alters the structure of the document and therefore breaks the old code that searches for the CSS to remove. This code is found in ucjs_downloadManagerMain.init()
:
// xxx remove in-content css
- var elements = document.childNodes;
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- if (element.nodeValue && element.nodeValue.indexOf("chrome://browser/skin/downloads/contentAreaDownloadsView.css") > -1) {
- document.removeChild(element);
- break;
- }
- }
+ let element = document.querySelector('link[href$="skin/downloads/contentAreaDownloadsView.css"]');
+ if(element) element.parentNode.removeChild(element);
That change to querySelector()
fixed the issue for me.