userChrome.js icon indicating copy to clipboard operation
userChrome.js copied to clipboard

ucjsDownloadsManager.uc.js breaks in Firefox 120

Open LummoxJR opened this issue 1 year ago • 0 comments

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.

LummoxJR avatar Nov 02 '23 17:11 LummoxJR