Warum?
Ich verstehe nicht, was das bezwecken soll.
Dann kann ich auch nicht mehr meinen Firefox starten!
Aber ich schrieb ja, dass ich einen Profilordner im Profilmanager des Nightly angelegt habe.
Er startet jetzt auch, nur lädt kein einziges JavaScript.
Beiträge von Mira_Belle
-
-
Kann gar nicht sein, ohne Profil startet Firefox gar nicht. Bei einer Neuinstallaation würde wahrscheinlich sogar ein neues angelegt werden. Sei einigen Jahren ist default-release Standard. Bei einer Neuinstallation wäre das dann default-release-1, default-release-2, default-release-3 usw.
Äh, doch!
Es wurde kein Profil angelegt!
Und klar, die Nightly startete dann auch nicht.
Habe dann im Profilmanager eines anlegen lassen.
So weit, so gut.
Per Hand, bzw. zu Fuß die Anpassungen zum Nutzen von JavaScript vorgenommen.Danach die wichtigsten Dateien aus dem Backup wieder hergestellt.
css, js.
Dann die Nightly gestartet und .... festgestellt, dass auch mit der neuen Installation die Skripte alle nicht ausgeführt werden.
Jetzt warte ich einfach mal das nächste Update ab. -
Muss/sollte der Script-Cache geleert werden?
Nicht mehr möglich.
Habe geputzt.Danach Rechner gebootet und die Nightly neu installiert:
Problem, es wird kein Profil angelegt! -
Nimm doch einfach die neuere Version.
JavaScript
Alles anzeigen// ==UserScript== // @name ucjsDownloadsManager.uc.js // @namespace http://space.geocities.yahoo.co.jp/gl/alice0775 // @description Donloads Manager // @include main // @include chrome://browser/content/downloads/contentAreaDownloadsView.xhtml // @compatibility Firefox 135 // @author Alice0775 // @version 2024/12/22 fix Bug 1936336 - Disallow inline event handlers // @version 2024/03/11 19:00 fix progressbar // @version 2023/11/17 00:00 Bug 1857999 - Stop using xml-stylesheet processing instructions for styling non-test xhtml documents // @version 2023/07/17 00:00 use ES module imports // @version 2023/06/20 remove Bug 1780695 - Remove Services.jsm // @version 2023/04/02 fix document.title // @version 2022/11/22 Bug 877389 - [meta] Replace calls to Cu.reportError, etc. from browser code, replace with console.error, etc. // @version 2022/11/08 11:00 Bug 1798212 // @version 2022/05/04 11:00 missing scope of DownloadIntegration // @version 2022/04/01 23:00 Convert Components.utils.import to ChromeUtils.import // @version 2022/02/16 Bug 1747422 - Remove preprocessor variable use from downloads CSS // @version 2020/12/19 WIP:Workaround to avoid closing the manager if download.error/download.canceled. // @version 2020/12/18 fix closeWhenDone if small size downloaded // @version 2020/09/24 fix emptylist layout // @version 2019/12/11 fix for 73 Bug 1601094 - Rename remaining .xul files to .xhtml in browser // @version 2019/10/20 12:30 workaround Bug 1497200: Apply Meta CSP to about:downloads, Bug 1513325 - Remove textbox binding // @version 2019/05/21 08:30 fix 69.0a1 Bug 1534407 - Enable browser.xhtml by default // @version 2019/05/21 08:30 fix 69.0a1 Bug 1551320 - Replace all createElement calls in XUL documents with createXULElement // @version 2018/07/01 16:30 revert Disable btn // @version 2018/06/12 21:30 remove unused // @version 2018/06/12 21:00 fix for private window mode // @version 2018/06/07 12:00 fix file name for history // @version 2018/04/14 00:00 de XUL overlay // @version 2017/12/10 12:00 fix error when DO_NOT_DELETE_HISTORY = true // @version 2017/12/10 12:00 remove workaround Bug 1279329. Disable btn while clear list is doing // @version 2016/06/10 00:00 Workaround Bug 1279329 // @version 2016/05/04 20:30 remove typo // @version 2016/05/04 20:00 remove in-content css, add preference for Taskbar Progress // @version 2016/05/03 01:00 Indicate Taskbar Progress // @version 2016/04/19 07:00 change title dexcription "/" instead of " of " // @version 2015/05/08 00:00 remove padding due to Bug 1160734 // @version 2015/03/29 00:00 Check window.windowState instead of sizemode attribute // @version 2014/12/28 23:00 Skip save window size if closed immediately // @version 2014-12-23 23:00 number of files // @version 2014-10-23 22:00 number of files // @version 2014/10/18 20:00 fix posiotion // @version 2014/06/07 20:00 Woraround closes // @version 2014/06/03 12:00 // @version 2014/05/15 22:00 clean up // @version 2014/05/15 20:00 removed the following oraround // @version 2014/05/15 19:00 Woraround closes the manager 10 seconds after download completion // @version 2014/03/31 00:00 fix for browser.download.manager.showWhenStarting // @version 2014/03/01 12:00 Bug 978291 // @version 2013/12/19 17:10 rename REMEMBERHISTOTY to DO_NOT_DELETE_HISTORY // @version 2013/12/19 17:00 fix do not close the Manager if there is main window // @version 2013/12/18 23:10 // @version 2013/12/16 23:10 open only download added // @version 2013/12/16 02:00 defineLazyModuleGetter for Firefox26 // @version 2013/12/15 22:00 typo and correct version date // @version 2013/12/15 08:00 label placeholder size // @version 2013/12/14 20:10 Search // @version 2013/12/14 19:30 getBoolPref // @version 2013/12/14 18:30 typo and fix closeWhenDone // @version 2013/12/14 18:00 browser.download.manager.showWhenStarting , browser.download.manager.closeWhenDone // @version 2013/12/02 00:00 // @note Require Sub-Script/Overlay Loader v3.0.40mod // ==/UserScript== // preferences: // 自動で開く(デフォルト true): // (bool) browser.download.manager.showWhenStarting // 自動で閉じる(デフォルト false): // (bool) browser.download.manager.closeWhenDone // 上記falseの場合,自動で開いたときにのみ自動で閉じる(デフォルト false): // (bool) browser.download.manager.closeWhenDoneIfAutoOpened // タスクバーにプロフレスメーターを表示(デフォルト true): // (bool) browser.download.manager.showProgressInTaskButton if (location.href == "chrome://browser/content/browser.xhtml") { window.ucjs_downloadManager = { delay: 500, //自動で閉じる設定の場合、 自動表示しない閾値(ミリ秒) _summary: null, _list: null, kshowWhenStarting: "browser.download.manager.showWhenStarting", kcloseWhenDone: "browser.download.manager.closeWhenDone", kcloseWhenDoneIfAutoOpened: "browser.download.manager.closeWhenDoneIfAutoOpened", createElement: function(localName, arryAttribute) { let elm = document.createXULElement(localName); for(let i = 0; i < arryAttribute.length; i++) { elm.setAttribute(arryAttribute[i].attr, arryAttribute[i].value); } return elm; }, init: function() { window.addEventListener("unload", this, false); let ref = document.getElementById("menu_openDownloads"); let menu = ref.parentNode.insertBefore( this.createElement("menuitem", [{attr: "id", value:"menu_openDownloadManager"}, {attr: "label", value:"Open Download Manager"}, {attr: "accesskey", value:"D"}, //{attr : "oncommand", value: "ucjs_downloadManager.openDownloadManager(true);"} ]), ref); document.getElementById("menu_openDownloadManager").addEventListener("command", () => ucjs_downloadManager.openDownloadManager(true)); ChromeUtils.defineESModuleGetters(this, { Downloads: "resource://gre/modules/Downloads.sys.mjs", }); // Ensure that the DownloadSummary object will be created asynchronously. if (!this._summary) { this.Downloads.getSummary(this.Downloads.ALL).then(summary => { this._summary = summary; return this._summary.addView(this); }).then(null, console.error); } if (!this._list) { this.Downloads.getList(this.Downloads.ALL).then(list => { this._list = list; return this._list.addView(this); }).then(null, console.error); } }, uninit: function() { window.removeEventListener("unload", this, false); if (this._summary) { this._summary.removeView(this); } if (this._list) { this._list.removeView(this); } }, handleEvent: function(event) { switch (event.type) { case "unload": this.uninit(); break; } }, getDMWindow: function() { var enumerator = Services.wm.getEnumerator(null); while(enumerator.hasMoreElements()) { var win = enumerator.getNext(); if (win.location == "chrome://browser/content/downloads/contentAreaDownloadsView.xhtml" && PrivateBrowsingUtils.isWindowPrivate(window) == PrivateBrowsingUtils.isWindowPrivate(win)) { return win; } } return null; }, openDownloadManager: function ucjs_openDownloadManager(aForceFocus) { var win = this.getDMWindow(); if (win) { if (aForceFocus) { win.focus(); win.autoOpened = false; } return false; //既存 } try { var height = Math.max(100,Services.prefs.getIntPref("browser.download.manager.size.height")); var width = Math.max(300,Services.prefs.getIntPref("browser.download.manager.size.width")); var screenX = Math.min(Math.max(0,Services.prefs.getIntPref("browser.download.manager.size.screenX")), screen.availWidth - width); var screenY = Math.min(Math.max(0,Services.prefs.getIntPref("browser.download.manager.size.screenY")), screen.availHeight - height); } catch(r){ height = 300; width = 600; screenX = 0; screenY = 0; } win = window.open("chrome://browser/content/downloads/contentAreaDownloadsView.xhtml", "Download" + (PrivateBrowsingUtils.isWindowPrivate(window) ? " - Private Window" : ""), "outerWidth=" + width + ",outerHeight=" + height + ",left=" + screenX + ",top=" + screenY + ",chrome,toolbar=yes,dialog=no,resizable"); this.success = true; if (aForceFocus) win.autoOpened = false; return win; //新規 }, success: true, onDownloadChanged: function (aDownload) { this.success = this.success && !(aDownload.canceled || aDownload.error); }, closeTimer: null, onSummaryChanged: function (aDownload) { var showWhenStarting = Services.prefs.getBoolPref(this.kshowWhenStarting, true); if (!showWhenStarting) //自動オープンでないならDMを開かない return var win = this.getDMWindow(); if (win) { // すでに開らかれている return; } if (this.success && this._summary.allHaveStopped) //エラーもダウンロード中がないならDMを開かない return; var closeWhenDone = Services.prefs.getBoolPref(this.kcloseWhenDone, false); var closeWhenDoneIfAutoOpened = Services.prefs.getBoolPref(this.kcloseWhenDoneIfAutoOpened, false); if (!this.success || !(closeWhenDone || closeWhenDoneIfAutoOpened)) { //エラーがあるまたは自動クローズでないならDMを開く var newWindow = this.openDownloadManager(false); if (newWindow) { newWindow.autoOpened = true; } } this.closeTimer = setTimeout(() => { if (this.success && this._summary.allHaveStopped) //エラーもダウンロード中もない return; newWindow = this.openDownloadManager(false); if (newWindow) { newWindow.autoOpened = true; } }, this.delay); } }; ucjs_downloadManager.init(); } if (window.opener && location.href == "chrome://browser/content/downloads/contentAreaDownloadsView.xhtml") { ChromeUtils.importESModule( "resource://gre/modules/DownloadIntegration.sys.mjs" ); window.ucjs_downloadManagerMain = { originalTitle:"", _hasDowbload: false, _summary: null, _list: null, _wait:false, kshowWhenStarting: "browser.download.manager.showWhenStarting", kcloseWhenDone: "browser.download.manager.closeWhenDone", kcloseWhenDoneIfAutoOpened: "browser.download.manager.closeWhenDoneIfAutoOpened", createElement: function(localName, arryAttribute) { let elm = document.createXULElement(localName); for(let i = 0; i < arryAttribute.length; i++) { elm.setAttribute(arryAttribute[i].attr, arryAttribute[i].value); } return elm; }, createElementNS: function(NS, localName, arryAttribute) { let elm = document.createElementNS(NS, localName); for(let i = 0; i < arryAttribute.length; i++) { elm.setAttribute(arryAttribute[i].attr, arryAttribute[i].value); } return elm; }, init: function() { window.addEventListener("unload", this, false); // xxx remove in-content css var element = document.querySelector("link[href='chrome://browser/skin/downloads/contentAreaDownloadsView.css']"); if (element) { element.parentNode.removeChild(element); } /* var elements = document.childNodes; for (var i = 0; i <= elements.length; i++) { var element = elements[i]; if (element.nodeValue.indexOf("chrome://browser/skin/downloads/contentAreaDownloadsView.css") > -1) { document.removeChild(element); break; } } */ /* var style = ' \ @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); \ #contentAreaDownloadsView { \ padding: 0 ; \ } \ #downloadsListBox:empty + #downloadsListEmptyDescription { \ pointer-events: none; \ } \ '.replace(/\s+/g, " "); var sspi = document.createProcessingInstruction( 'xml-stylesheet', 'type="text/css" href="data:text/css,' + encodeURIComponent(style) + '"' ); document.insertBefore(sspi, document.documentElement); sspi.getAttribute = function(name) { return document.documentElement.getAttribute(name); }; */ document.getElementById("downloadsListEmptyDescription").setAttribute("flex", "1"); let ref = document.documentElement; ref = ref.appendChild(this.createElement("hbox", [])); ref.appendChild(this.createElement("button", [{attr: "id", value: "ucjs_clearListButton"}, {attr: "label", value: "Clear List"}, {attr: "accesskey", value: "C"} ])); ref.appendChild(this.createElement("spacer", [{attr: "flex", value: "1"}])); ref.appendChild(this.createElementNS("http://www.w3.org/1999/xhtml", "input", [{attr: "id", value: "ucjs_downloadManagerMain_input"}, {attr: "clickSelectsAll", value: "true"}, {attr: "type", value: "search"}, {attr: "placeholder", value: "Search..."}, {attr: "aria-autocomplete", value: "list"} ])); document.getElementById("ucjs_clearListButton").addEventListener("command", function(event) { ucjs_downloadManagerMain.clearDownloads(); }); document.getElementById("ucjs_downloadManagerMain_input") .addEventListener("input", function(event) { ucjs_downloadManagerMain.doSearch(event.target.value); }); this.originalTitle = document.title + (PrivateBrowsingUtils.isWindowPrivate(window) ? " - Private Window" : ""); document.title = this.originalTitle; /* // xxx Bug 1279329 "Copy Download Link" of context menu in Library is grayed out var listBox = document.getElementById("downloadsListBox"); var placesView = listBox._placesView; var place = placesView.place; placesView.place= null; placesView.place = place; */ setTimeout(function(){this._wait = true}.bind(this), 0); // Ensure that the DownloadSummary object will be created asynchronously. if (!this._summary) { Downloads.getSummary(Downloads.ALL).then(summary => { this._summary = summary; return this._summary.addView(this); }).then(null, console.error); } if (!this._list) { Downloads.getList(Downloads.ALL).then(list => { this._list = list; return this._list.addView(this); }).then(null, console.error); } const lazy = {}; ChromeUtils.defineLazyGetter(lazy, "gWinTaskbar", function () { if (!("@mozilla.org/windows-taskbar;1" in Cc)) { return null; } let winTaskbar = Cc["@mozilla.org/windows-taskbar;1"].getService( Ci.nsIWinTaskbar ); return winTaskbar.available && winTaskbar; }); var showProgressInTaskButton = Services.prefs.getBoolPref("browser.download.manager.showProgressInTaskButton", true); if (showProgressInTaskButton) { setTimeout(function() { try { let { docShell } = window.browsingContext.topChromeWindow; this._taskbarProgress = lazy.gWinTaskbar.getTaskbarProgress(docShell); } catch(ex) { this._taskbarProgress = null; } }.bind(this), 10); } }, uninit: function() { window.removeEventListener("unload", this, false); this._taskbarProgress = null; if (this._wait) this.saveSizePosition(); if (this._summary) { this._summary.removeView(this); } if (this._list) { this._list.removeView(this); } }, handleEvent: function(event) { switch (event.type) { case "unload": this.uninit(); break; } }, saveSizePosition: function() { if (window.windowState == 3) { Services.prefs.setIntPref("browser.download.manager.size.height", window.outerHeight); Services.prefs.setIntPref("browser.download.manager.size.width", window.outerWidth); Services.prefs.setIntPref("browser.download.manager.size.screenX", window.screenX); Services.prefs.setIntPref("browser.download.manager.size.screenY", window.screenY); } }, success: true, onDownloadChanged: function (aDownload) { this.success = this.success && !(aDownload.canceled || aDownload.error); }, onSummaryChanged: function () { if (!this._summary) return; if (!this._hasDowbload) { this._hasDowbload = true; return; } if (this._summary.allHaveStopped || this._summary.progressTotalBytes == 0) { document.title = this.originalTitle; if (this._taskbarProgress) { this._taskbarProgress.setProgressState( Ci.nsITaskbarProgress.STATE_NO_PROGRESS, 0, 0); } var closeWhenDone = Services.prefs.getBoolPref(this.kcloseWhenDone, false); var closeWhenDoneIfAutoOpened = Services.prefs.getBoolPref(this.kcloseWhenDoneIfAutoOpened, false) && window.autoOpened; if (this.success && (closeWhenDone || closeWhenDoneIfAutoOpened)) { window.DownloadIntegration?._store?.save(); window.close(); } } else { // If the last browser window has been closed, we have no indicator any more. if (this._taskbarProgress) { if (this._summary.allHaveStopped || this._summary.progressTotalBytes == 0) { this._taskbarProgress.setProgressState( Ci.nsITaskbarProgress.STATE_NO_PROGRESS, 0, 0); } else { // For a brief moment before completion, some download components may // report more transferred bytes than the total number of bytes. Thus, // ensure that we never break the expectations of the progress indicator. let progressCurrentBytes = Math.min(this._summary.progressTotalBytes, this._summary.progressCurrentBytes); this._taskbarProgress.setProgressState( Ci.nsITaskbarProgress.STATE_NORMAL, progressCurrentBytes, this._summary.progressTotalBytes); } } // Update window title var numDls = 0; if (!this._list) return; this._list.getAll().then(downloads => { for (let download of downloads) { if (download.hasProgress && !download.succeeded) numDls++; } let progressCurrentBytes = Math.min(this._summary.progressTotalBytes, this._summary.progressCurrentBytes); let percent = Math.floor(progressCurrentBytes / this._summary.progressTotalBytes * 100); let text = percent + "%/" + numDls + (numDls < 2 ? " file - " : " files - ") ; document.title = text + this.originalTitle; }).then(null, console.error); } }, clearDownloads: function ucjs_clearDownloads() { var DO_NOT_DELETE_HISTORY = true; /* custmizable true or false */ var richListBox = document.getElementById("downloadsListBox"); var places = []; function addPlace(aURI, aTitle, aVisitDate) { places.push({ uri: aURI, title: aTitle, visits: [{ visitDate: (aVisitDate || Date.now()) * 1000, transitionType: Ci.nsINavHistoryService.TRANSITION_LINK }] }); } function moveDownloads2History(d) { if (DO_NOT_DELETE_HISTORY && !PrivateBrowsingUtils.isWindowPrivate(window)) { for (let element of richListBox.childNodes) { let download = element._shell.download; let aURI = makeURI(download.source.url); // let aTitle = document.getAnonymousElementByAttribute(element, "class", "downloadTarget").value let aTitle = download.target.path; aTitle = aTitle.match( /[^\\]+$/i )[0]; aTitle = aTitle.match( /[^/]+$/i )[0]; let aVisitDate = download.endTime || download.startTime; addPlace(aURI, aTitle, aVisitDate) } } // Clear List richListBox._placesView.doCommand('downloadsCmd_clearDownloads'); if (DO_NOT_DELETE_HISTORY && !PrivateBrowsingUtils.isWindowPrivate(window)) { if (places.length > 0) { var asyncHistory = Components.classes["@mozilla.org/browser/history;1"] .getService(Components.interfaces.mozIAsyncHistory); asyncHistory.updatePlaces(places); } } } var btn = document.getElementById("ucjs_clearListButton"); moveDownloads2History(0); }, doSearch: function ucjs_doSearch(filterString) { var richListBox = document.getElementById("downloadsListBox"); richListBox._placesView.searchTerm = filterString; } }; ucjs_downloadManagerMain.init(); } -
Wie hattest du denn eigentlich denn das Update gemacht? Über den Aktualisierungseintrag/Pfeil im Hamburger-Menü?
Hilfe \ Über Firefox
Dann im Dialog das Update angeworfen. -
Da bleibt dir nichts anderes übrig, als die Vorbereitung für Skripte noch einmal zu machen bzw. zu überprüfen.
Habe ich schon zweimal gemacht! Und alles von Hand!
Abgesehen davon, dass das Runterlanden vom Update (10MB) über eine Minute gedauert hat, funktionieren hier auch alle Skripte.
Mh, bei mir nicht. Kann man die aktuelle Nightly irgendwo herunterladen?
Damit ich diese noch einmal von Hand drüber bügeln kann?Du hast dir nicht zufällig irgendwas verbogen mit dem neuen Script?

Eher unwahrscheinlich.
Die Tests habe ich heute Mittag gemacht und der Firefox sowie die Nightly wurden zwischendurch auch ein paar Mal neugestartet.
Vor dem Update, das war jetzt vor ca. 2h, liefen noch alle Skripte mit der Version 139.0a1 (2025-04-28) (64-Bit).
Nach dem Update auf 140.0a1 (2025-04-29) (64-Bit) nicht mehr! -
Mh, dann hat mein altersschwaches Hirn da was verwechselt!
Dennoch geht nicht ein Skript! -
Hast du irgendetwas an den notwendigen Skriptdateien geändert? Also an der userChrome.js im Profil und an den Dateien/dem Ordner userChromeJS im Installationsverzeichnis? Hast du ein neues Profilverzeichnis oder Installationsverzeichnis?
Nein!
Bis eben, vor ca. einer Stunde, funktionierten alle Skripte noch!
Es war aber noch die Nightly von Gestern
Dann das Update gemacht, nicht ein Skript geht!
Mir war, mir ist, als hätte Sören Hentzschel irgendwo erwähnt, dass das passieren könnte
und dass es dazu in der about:config etwas umgestellt werden müsste. -
Aktuell funktionieren in der Nightly 140.0a1 (2025-04-29) (64-Bit) gar keine Skripte mehr!
Muss da was unter about:config umgestellt werden?
Mir war da so, aber ich finde den Beitrag nicht mehr. -
Es ist vollbracht!
Das Skript führt die auf Endors Seite beschriebenen Schritte von alleine durch.Das Zip wird heruntergeladen und entpackt.
Und die entsprechenden Ordner angelegt und die Dateien abgelegt.Was mir fehlt, ein guter Name für das Skript

Ich habe es kurzerhand einfach "Firefox-JavaScript_install.ps1" genannt.
Danke .DeJaVuCode
Alles anzeigen# ==UserScript== # @name Firefox-JavaScript_install # @description Firefox-JavaScript_install.ps1 # @include ~ coming soon # @author TK87 @ supernature-forum.de # @version 2025/04/29 v.1.2 # ==/UserScript== #region SETTINGS Using NameSpace System.Management.Automation Using NameSpace System.Security.Principal Using NameSpace System.Windows.Forms Param([string]$User) Add-Type -AssemblyName System.Windows.Forms if (!$User) {$User = $Env:UserName} $ErrorActionPreference = 'stop' #endregion SETTINGS function CloseFirefoxMessage { $Form = [Form]@{StartPosition='CenterScreen'; AutoSize=$true; Padding='10,10,10,10'; BackColor='White'; ControlBox=$false; Size="10,10"; Text='Firefox beenden'; FormBorderStyle='FixedSingle'} $TLP = [TableLayoutPanel]@{Dock='Fill'; AutoSize=$true} $FLP = [FlowLayoutPanel]@{AutoSize=$true; Anchor="Bottom"} $Label = [Label]@{Text= "Firefox läuft derzeit. Bitte schließen Sie Firefox, bevor Sie fortfahren."; Font="Verdana,12"; AutoSize=$true; MaximumSize="400,300"} $Buttons = @( [Button]@{Text="Ok"; Size="80,30"; Font="Microsoft Sans Serif,10"; Margin="10,10,10,10"} [Button]@{Text="Abbruch"; Size="80,30"; Font="Microsoft Sans Serif,10"; Margin="10,10,10,10"} ) $Buttons.Add_Click({ $this.TopLevelControl.Hide() $this.TopLevelControl.Tag = $this.Text }) $FLP.Controls.AddRange($Buttons) $TLP.Controls.Add($Label) $TLP.Controls.Add($FLP) $Form.Controls.Add($TLP) return $Form } Function FF-Chooser { Param([Array]$items) $Form = [Form]@{StartPosition='CenterScreen'; Font='Verdana,12'; AutoSize=$true; Padding='10,10,10,10'; Size='1,1'; ControlBox=$false; BackColor='white'; FormBorderStyle='FixedSingle'} $TLP = [TableLayoutPanel]@{Dock='Fill'; AutoSize=$true} $Label = [Label]@{Text="Für welchen Firefox sollen die Anpassungen vorgenommen werden?"; AutoSize=$true; MaximumSize='500,500'; Font='Verdana, 14'; Margin='10,10,10,10'} $FLP = [FlowLayoutPanel]@{AutoSize=$true; Anchor='Bottom'} $TLP.SetColumnSpan($Label,3) $TLP.Controls.Add($Label,0,0) $i=1 foreach ($item in $items) { $checkbox = [CheckBox]@{Name=$item.DisplayName; AutoSize=$true; Size='1,1'; Anchor='Left'; Margin='40,10,10,10'} $icon = [Drawing.Icon]::ExtractAssociatedIcon(('{0}\Firefox.exe' -f $item.InstallLocation)) $panel = [Panel]@{Size='25,25'; Anchor='Left'; BackgroundImage=$icon; BackgroundImageLayout='zoom'} $Label = [Label]@{Text=$item.DisplayName; Anchor='Left'; AutoSize=$true} $TLP.Controls.Add($checkbox,0,$i) $TLP.Controls.Add($panel,1,$i) $TLP.Controls.Add($label,2,$i) $i++ } $Buttons = @( [Button]@{Text='Ok'; Size='100,40'; Margin='10,10,10,10'; Font='Microsoft Sans Serif,11'} [Button]@{Text='Abbruch'; Size='100,40'; Margin='10,10,10,10'; Font='Microsoft Sans Serif,11'} ) $Buttons.Add_Click({$this.ToplevelControl.Hide(); $this.ToplevelControl.Tag = $this.Text}) $TLP.SetColumnSpan($FLP,3) $FLP.Controls.AddRange($Buttons) $TLP.Controls.Add($FLP,0,$i) $Form.Controls.Add($TLP) return $Form } try { # 1. Prüfen, ob Firefox installiert ist $FFs = '','Wow6432Node\'|%{gp "HKLM:\Software\${_}Microsoft\Windows\CurrentVersion\Uninstall\*"} |?{$_.Publisher -eq 'Mozilla' -and $_.DisplayName -match 'Firefox|Nightly'} if (!$FFs) { throw [NotSupportedException]::new('Firefox ist nicht installiert.') } # 2. Prüfen, ob mit Administrator-Rechten gestartet if (![WindowsPrincipal]::new([WindowsIdentity]::GetCurrent()).IsInRole(544)) { # Skript als Administrator neustarten... try { # Bei Ausführung unter Powershell... if ($MyInvocation.MyCommand.CommandType -eq "ExternalScript"){Start -Verb RunAs Powershell -ArgumentList ('-NoLogo -File "{0}" "{1}"' -f $MyInvocation.MyCommand.Definition,$Env:UserName)} # Bei Ausführung als EXE umgewandelt... else {Start -Verb RunAs ([Environment]::GetCommandLineArgs()[0]) -ArgumentList "$User"} } catch {} return } # 3. Prüfen, ob mehrere Installationen vorhanden $FFids = '','Wow6432Node\'|%{gp "HKLM:\Software\${_}Mozilla\Firefox\TaskBarIDs"|%{$_.PsObject.Properties}}|Select -unique If ($FFs.Count){ $Form = FF-Chooser $FFs [void]$Form.ShowDialog() $Checkbox = $Form.Controls[0].Controls|?{$_ -is 'checkbox' -and $_.Checked} if ($Form.Tag -eq 'Abbruch' -or !$Checkbox) {return} $FF = Foreach ($item in $Checkbox.Name) { $FFs|? DisplayName -eq $item|%{@{ Name = $_.DisplayName Location = $_.InstallLocation Id = $FFids | ? Name -eq $_.InstallLocation |%{$_.Value} }} } } else { $FF = @(@{ Name = $FFs.DisplayName Location = $FFs.InstallLocation Id = $FFids.PsObject.Properties | ? Name -eq $FFs.InstallLocation |%{$_.Value} }) } # 4. Prüfen, ob Firefox läuft try { Get-Process Firefox | Out-Null $Form = CloseFirefoxMessage do { [void]$Form.ShowDialog() if ($Form.Tag -eq "Abbruch") {return} } until (!(Get-Process FireFox)) } catch {} # 4. ZIP herunterladen und entpacken $tempDir = "$ENV:Temp\{0}" -f (New-Guid).Guid md $tempDir | Out-Null $zipUrl = "https://raw.githubusercontent.com/Endor8/userChrome.js/master/userChrome/Dateien/firefox-anpassungen.zip" $zipPath = "$tempDir\firefox-anpassungen.zip" Write-Host -NoNewLine "Firefox-Anpassungen werden heruntergeladen... " [System.Net.WebClient]::new().DownloadFile($zipUrl,$zipPath) Write-Host -ForegroundColor Green "ok." Write-Host -NoNewLine "Archiv wird entpackt... " Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force Write-Host -ForegroundColor Green "ok." # Install-Ini lesen $ini = @{} foreach ($line in Get-Content "C:\Users\$user\Appdata\Roaming\Mozilla\Firefox\installs.ini") { switch -RegEx ($line) { '^\[(.+)\]$' {$section=$Matches[1]; $ini.$section=@{}} '^(.+)=(.*)' {$key,$value=$Matches[1,2]; $ini.$section.$key=$value} } } # Datei kopieren foreach ($item in $FF) { "" Write-Host ('Beginne Kopiervorgang für: {0}' -f $item.Name) $FF_location = $item.Location Write-Host -NoNewLine "Datei 'config-prefs.js' wird ins Firefox-Verzeichnis kopiert... " Copy-Item -Path "$tempDir\config-prefs.js" -Destination "$FF_location\defaults\pref" Write-Host -ForegroundColor Green 'ok.' # Zielordner userChromeJS erstellen, falls nicht vorhanden if (!(Test-Path "$FF_location\userChromeJS")) { Write-Host -NoNewLine "Zielordner 'userChromeJS' wird erstellt... " md "$FF_location\userChromeJS" | Out-Null Write-Host -ForegroundColor Green 'ok.' } # Dateien einzeln kopieren foreach ($file in "main.js","Readme.txt","utilities.js") { if (Test-Path "$tempDir\userChromeJS\$file") { Write-Host -NoNewLine "Datei '$file' wird kopiert... " Copy-Item -Path "$tempDir\userChromeJS\$file" -Destination "$FF_location\userChromeJS" Write-Host -ForegroundColor Green "ok." } else { Write-Warning "Datei '$file' wurde nicht gefunden und wird übersprungen." } } # Datei kopieren Write-Host -NoNewLine "Datei 'config.js' wird ins Firefox-Verzeichnis kopiert... " Copy-Item -Path "$tempDir\config.js" -Destination $FF_location Write-Host -ForegroundColor Green "ok." # Profilordner finden $profilePath = $ini.GetEnumerator() |? Key -eq $item.id|%{ if ([System.IO.Path]::IsPathRooted($_.Value.Default)){$_.Value.Default} else {"C:\Users\$user\Appdata\Roaming\Mozilla\Firefox\"+$_.Value.Default} Write-Host ("Standardprofilordner: {0}" -f $_.Value.Default) } if (!$profilePath) { Write-Warning ("Das Standardprofil für '{0}' konnte nicht gefunden werden und wird übersprungen" -f $item.Name) continue } # chrome-Ordner erstellen, falls nicht vorhanden if (!(Test-Path "$profilePath\chrome")) { Write-Host -NoNewLine "Ordner 'chrome' wird erstellt..." md "$profilePath\chrome" | Out-Null Write-Host -ForegroundColor green "ok." } # userChrome.js kopieren Write-Host -NoNewLine "Datei 'userChrome.js' wird kopiert... " Copy-Item -Path "$tempDir\chrome\userChrome.js" -Destination "$profilePath\chrome" Write-Host -ForegroundColor Green "ok." } Write-Host -ForegroundColor Green "Der Vorgang wurde erfolgreich abgeschlossen." } catch [NotSupportedException] { Write-Warning $_.Exception.Message } catch { Write-Host -ForegroundColor Red $_.Exception.Message } if ($tempDir -and (Test-Path $tempDir)) {remove-item -force -recurse $tempDir} Write-Host -NoNewLine -ForegroundColor Yellow "`n--- Beliebige Taste zum Beenden ---" [void][console]::ReadKey($true) # MIT License # # Copyright (c) 2025 TK87 @ camp-firefox.de # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is furnished to do so. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -
.DeJaVu Magst Du mir auf die Sprünge helfen?
Die "profiles.ini" auf Default=1 abzufragen, ergibt keinen Sinn.
Hat der Nutzer keine andere Firefoxversion installiert, gibt es diesen einfach nicht.Hat der User z.B. zwei Profile, kann die "profiles.ini" so aussehen:
Code
Alles anzeigen[Install308046B0AF4A39CB] Default=Profiles/Testumgebung Locked=1 [Profile1] Name=Testumgebung IsRelative=1 Path=Profiles/Testumgebung [Profile0] Name=Mira IsRelative=1 Path=Profiles/Mira [General] StartWithLastProfile=0 Version=2Auch hier habe ich das Problem, dass ich nicht weiß, wie ich an das Standardprofil, in diesem Fall "Mira", heran komme.
Um eine Abfrage, ob es sich um eine "normale" Installation handelt,
also ohne parallel laufenden Versionen,
könnte ja auch die "install.ini" abfragenCode[6F193CCC56814779] Default=Profiles/790r9b33.Nightly Locked=1 [308046B0AF4A39CB] Default=Profiles/Mira Locked=1und wenn mehr als ein [xxxxxx] vorkommt einfach das Skript mit Meldung stoppen.
(x seht als Platzhalter)
-
.DeJaVu Ich habe nicht das Handtuch geworfen!
Es gibt ein Skript, aber es hat noch den einen oder anderen Bug!
Z.Z. klappt es mit dem Profilordner nicht so!
B,z.w. dem Auslesen der "profiles.ini". -
apollo_13 Einen Link wäre gar nicht schlecht, ab besten genau zu dieser Page.
-
@Horstmann Das Skript wird definitiv nur für Windows sein!
Es soll recht einfach sein, d.h. es soll, es muss nichts am Skript geändert werden.
Einfach anklicken, warten, fertig.
Danach sollen JS-Dateien einfach genutzt werden können.ich dachte das suggeriert einen Diskussionswunsch.

Jain. Codebeispiele, oder auch Anmerkungen zum "Ablaufplan", gerne.
-
-
Hi, das Projekt ist abgeschlossen.
Ich werde das Skript irgendwann, wenn ich einen Versuchsaufbau habe, ausprobieren.
Wer es ausprobieren möchte, auf eigene Gefahr
Kann es bei mir anfordern.
Wäre eventuell schön, wenn jemand der sich (auch) mit PowerShell auskennt,
mal einen Blick drauf wirft.
Es muss ja nicht gleich getestet werden, wobei das echt klasse wäre. -
Solltest du vorhaben, es selektiv über private Nachrichten zu verteilen, bin ich eh raus.
Warum, wenn ich fragen darf?
Was soll den großartig passieren?
Keine Ahnung, die Hölle friert zu, wichtige Dateien werden gelöscht oder überschrieben?
Ich weiß es nicht! Wollte halt nur relativ sicher gehen, bevor es jeder auf seinem Rechner ausführen kann.Nachtrag!
Dein Script ...
Es ist nicht MEIN Skript.
Es hat mir jemand, der m.M. gut mit PS kann, geholfen
Besser, eigentlich stammt es von ihm, das hätte ich aber auf jeden Fall noch kommuniziert. -
Suche ein paar Leute, die auf einer VM oder einem Testrechner etwas ausprobieren könnten.
Das BS sollte Windows 10 oder 11 sein.
Der Firefox sollte ganz normal, ohne irgendwelche Verrenkungen installiert sein!
Es geht um das Projekt: Installations Skript zur Vorbereitung des FF zur Nutzung von JavaScript.Es gibt nun ein Skript und ich möchte wissen, ob es fehlerfrei funktioniert.
Und gleich vorweg, ich habe leider keinen Testrechner
und mit VM stehe ich auf Kriegsfuß!
Habe mich mit Microsofts VM-Lösung abgequält und nie so richtig zum Laufen bekommen.
Und extra eine Software installieren wollt' ich auch nicht unbedingt. -
Das Problem, was ich hier im PS-Script sehe: kein Konzept.
Ja, da hast Du recht!
War ja auch nur ein, ... na ja, Schnellschuss.Ich Augenblick bin ich am überlegen, welche Schritte so nach und nach abgearbeitet werden müssen,
und versuche das dann in eine eventuell richtige Reihenfolge zu bekommen.
Also Deine Sache mit dem Blatt Papier.
So ein klein wenig habe ich aus dem Durcheinander von vor zwei Jahren dann doch gelernt, hoffe ich.
Wenn so etwas wie ein Ablaufplan erstellt ist, werde ich mir noch einmal überlegen,
in welcher Form das dann umgesetzt werden soll.
Vielleicht finde ich ja einen oder zwei, die mir dann helfen das umzusetzen.
Die werden auf jeden Fall erwähnt, nicht dass es dann wieder heißt,
ich wolle die Lorbeeren einheimsen.
So bin ich nicht
-
Okey
1:0 für Dich.
Und DAS ist quasi der Quellcode?
Code
Alles anzeigen;---------------------------------------- SetCompressor /SOLID lzma ShowInstDetails show AutoCloseWindow true CRCCheck On Icon "firefox.ico" Name "firefox-anpassungen" OutFile "firefox-anpassungen_install.exe" XPStyle on !addincludedir "$EXEDIR" ;---------------------------------------- LoadLanguageFile "German1.nlf" ;---------------------------------------- InstallDir "C:\Program Files\Mozilla Firefox\" Page directory Page instfiles ;---------------------------------------- Section "" CreateDirectory "$INSTDIR" SetOutPath "$INSTDIR" SetOverwrite on DetailPrint "Dateien extrahieren..." File /r ".\firefox-anpassungen\*.*" MessageBox MB_YESNO|MB_DEFBUTTON1|MB_ICONQUESTION|MB_SETFOREGROUND "M�chten Sie das Zielverzeichnis jetzt angezeigt bekommen?" IDNO no Exec '"explorer.exe" $INSTDIR' no: SectionEnd ;----------------------------------------Aber ich kann da gar nicht erkennen woher die ZIP kommt.