In Anbetracht der Klima-Entwicklung
Ja, im Frühling wird es wieder wärmer.![]()
In Anbetracht der Klima-Entwicklung
Ja, im Frühling wird es wieder wärmer.![]()
Dein Script von hier RE: externalApplications.uc.js Script funktioniert nich ab Firefox 136 beta habe ich noch etwas verändert, damit keine Fehler mehr in der Konsole.
Außerdem hab ich es als Menü angepasst und im Code in die Addonbar verlegt, funktioniert perfekt.
// ==UserScript==
// @name XP - Spider.uc.js
// @namespace ithinc#mozine.cn
// @description External Applications
// @include main
// @compatibility Firefox 3.5.x
// @author ithinc
// @version 20091212.0.0.1 Initial release
// ==/UserScript==
/* :::: External Applications :::: */
var gExternalApplications = {
type: 'menu', //'menu' or 'button'
insertafter: '',
apps: [
{name: 'notepad++', path: 'C:\\notepad++\\notepad++.exe'},
{name: 'Firefox Nightly 3', path: 'G:\\Portable.Firefox.Updater.3\\Firefox Nightly x64 Launcher.exe'},
],
init: function() {
for (var i=0; i<this.apps.length; i++) {
if (!this.apps[i].path) continue;
if (!this.apps[i].args) this.apps[i].args = [];
this.apps[i].path = this.apps[i].path.replace(/\//g, '\\');
var ffdir = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('CurProcD', Ci.nsIFile).path;
if (/^(\\)/.test(this.apps[i].path)) {
this.apps[i].path = ffdir.substr(0,2) + this.apps[i].path;
}
else if (/^(\.)/.test(this.apps[i].path)) {
this.apps[i].path = ffdir + '\\' + this.apps[i].path;
}
}
if (location.href !== 'chrome://browser/content/browser.xhtml') return;
if (this.type == 'menu') {
var mainmenu = document.getElementById('addonbar');
var menu = mainmenu.appendChild(document.createXULElement('menu'));
menu.setAttribute('label', 'Start');
menu.setAttribute('accesskey', 'a');
var menupopup = menu.appendChild(document.createXULElement('menupopup'));
for (var i=0; i<this.apps.length; i++) {
menupopup.appendChild(this.createMenuitem(this.apps[i]));
}
}
else {
var menubarItems = document.getElementById(this.insertafter);
var toolbaritem = menubarItems.parentNode.insertBefore(document.createXULElement('toolbaritem'), menubarItems.nextSibling);
toolbaritem.id = 'ExtAppButtons';
toolbaritem.setAttribute("class", "chromeclass-toolbar-additional");
toolbaritem.setAttribute("orient", "horizontal");
for (var i=0; i<this.apps.length; i++) {
toolbaritem.appendChild(this.createButton(this.apps[i]));
}
}
},
exec: function(path, args) {
for (var i=0; i<args.length; i++) {
args[i] = args[i].replace(/%u/g, gBrowser.currentURI.spec);
}
var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
file.initWithPath(path);
if (!file.exists()) {
throw 'File Not Found: ' + path;
}
if (!file.isExecutable() || args.length==0) {
file.launch();
}
else {
var process = Cc['@mozilla.org/process/util;1'].getService(Ci.nsIProcess);
process.init(file);
process.run(false, args, args.length);
}
},
createButton: function(app) {
if (app.name == 'separator')
return document.createXULElement('toolbarseparator');
if (location.href !== 'chrome://browser/content/browser.xhtml') return;
var item = document.createXULElement('toolbarbutton');
item.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional');
item.setAttribute('label', app.name);
item.setAttribute('image', 'moz-icon:file:///' + app.path + '?size=16');
// item.setAttribute('oncommand', 'gExternalApplications.exec(this.path, this.args);');
item.addEventListener ('command', function (event) {
if (event.button == 0) {
gExternalApplications.exec(this.path, this.args);
}
});
// item.setAttribute('tooltiptext', app.name);
item.path = app.path;
item.args = app.args;
return item;
},
createMenuitem: function(app) {
if (app.name == 'separator')
return document.createXULElement('menuseparator');
var item = document.createXULElement('menuitem');
item.setAttribute('class', 'menuitem-iconic');
item.setAttribute('label', app.name);
item.setAttribute('image', 'moz-icon:file:///' + app.path + '?size=16');
// item.setAttribute('oncommand', 'gExternalApplications.exec(this.path, this.args);');
item.addEventListener ('command', function (event) {
if (event.button == 0) {
gExternalApplications.exec(this.path, this.args);
}
});
item.path = app.path;
item.args = app.args;
return item;
}
};
gExternalApplications.init();
Alles anzeigen
Danke
Aber gerne doch, das habe ich so in allen Scripten gemacht, die ich dir gezeigt hatte, und da gibt es dann keine Fehler mehr in der Konsole. ![]()
![]()
Die habe ich hier auch, funktioniert trotzdem
Wenn du das, was in Zeile 16 steht, einfügst, dann sollte kein Fehler mehr angezeigt werden.
Nope, funktioniert hier auch nicht.
Sehr komisch, hier in allen 137.![]()
Auch mit Update auf Version 136 hat sich daran nichts geändert. Wird im Dialog der Button zum Neustart betätigt, so passiert nichts, und die Aufforderung zum Restart kommt immer wieder.
Erst wenn über die exe-Datei der Normalstart durchgeführt wird, dann ist auch das Update installiert.
Hallo zusammen,
im Nightly 137.0a1 funktioniert folgendes Script nicht mehr
Das Update auf 137 habe ich noch nicht, aber teste mal dieses Script, funktionierte in 136 überall (Addonbar, usw.).
// Button zum Aufruf der Browser-Konsole
(function() {
if (location.href !== 'chrome://browser/content/browser.xhtml') return;
try {
ChromeUtils.importESModule("resource:///modules/CustomizableUI.sys.mjs");
const sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService);
const button_label = "Konsole Button (generic)";
const open_in_a_window = false;
CustomizableUI.createWidget({
id: "kosole-button",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: button_label,
tooltiptext: button_label,
onClick: function(event) {
const win = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator)
.getMostRecentWindow("navigator:browser");
if(event.button == '0') {
try {
let { require } = ChromeUtils.importESModule("resource://devtools/shared/loader/Loader.sys.mjs", {});
let { BrowserConsoleManager } = require('resource://devtools/client/webconsole/browser-console-manager');
BrowserConsoleManager.openBrowserConsoleOrFocus();
} catch (e) {}
}
},
onCreated: function(button) {
return button;
}
});
// style button icon
const uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent('\
\
#kosole-button .toolbarbutton-icon { \
list-style-image: url("file:///C:/FoxIcons2/konsole2.png"); \
}\
\
'), null, null);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} catch (e) {
Components.utils.reportError(e);
};
})();
Alles anzeigen
im Nightly nutze ich ja ein korrigiertes Appmenü-Skript!
Na siehst Du, das war doch mein Reden, nun funktioniert es auch hier im Nightly.![]()
![]()
![]()
Bin dann mal weg.
Bis dann!![]()
Danke auch an Fuchsfan, aber das ging schon länger nicht mehr. Wir hatten dazu schon mal eine Diskussion
Und wieso klappt das hier im Nightly?![]()
Aber egal, es funktioniert ja.![]()
Gibts denn eine andere Möglichkeit, die Tabs mittig zu gruppieren?
Ja, wenn du den Code in die userChrome.css einfügst, also nicht in die userChromeShadow.css. Versuch mal bitte.
Aber so ganz verstehe ich es nicht, da bei mir die Kombi der Skripte funktionieren.
Deswegen mach Dir keinen Stress, ich nutze es nicht, weil ich mein eigenes Appmenu-Script habe.
Nur um es mal zu testen habe Deines installiert (beide). Das hatte ich schon mitgeteilt, es wird alles angezeigt, aber nur aus dem Menü-Script lassen sich die Einträge bedienen. Die vier Einträge (Verzeichnisse, usw.) reagieren nicht.
Leider auch mit den von vorgeschlagenen Änderungen nicht...
- oder hab ich da was falsch verstanden?
Nein, ist richtig verstanden, denn die Änderungen haben hier in Nightly nichts bewirkt.![]()
Bitte zeige mir Dein Skript (im Original) und die Änderung, die Du vornehmen musst
Schade, das Script ist gelöscht, aber kein Problem, Du nimmst Dein Script und überschreibst mit dem folgende Code ab _externalAppPopup: null, den letzten Teil.
Dann hast Du genau das Script, mit dem ich getestet habe. Ist dann aber mit Deinem Original nicht mehr vergleichbar.
_externalAppPopup: null,
_isready: false,
init: function() {
this.handleRelativePath(this.toolbar.apps);
const XULNS = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';
var ExternalAppBtn = document.createElementNS(XULNS, 'toolbarbutton');
ExternalAppBtn.id = "AppMenuButton";
ExternalAppBtn.setAttribute("label", "AppButton");
//ExternalAppBtn.setAttribute("onclick", "event.preventDefault();event.stopPropagation();");
ExternalAppBtn.addEventListener('click', event => {
event.preventDefault();
event.stopPropagation();
});
ExternalAppBtn.setAttribute("tooltiptext", "Firefox Menü");
ExternalAppBtn.setAttribute("type", "menu");
ExternalAppBtn.setAttribute("removable", "true");
if (Appmenu.isButton) {
ExternalAppBtn.style.listStyleImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAAUCAYAAAAwaEt4AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF3SURBVFhH7ZUxS8RAEIX9M1fb29vb+wP8AdaCYCVY2FmInY1YWmlrp7WtNp6ihyKKCDYrb7kPxsuMJiG5CO6DR5LZmd2Zl9ndhduNUSqssggTsAgTsAgTsAgTsLEw71enyYPGHvZW8vvHzUUlrinvd5e/reX59Mk/K8zn5DrPBTyfPtlamOeTTXe8K4LHg1V3vG92KgwdI2ADT8fr+UmcfNVZ4OVspzIH0Joau9teSq/n+1Nryl1l8yA3/LUdgWLxq8NOthKJ/CQMUCE2YQuJEwkz3lqsbC+AOCoeaB5y1U8hn7qcmzB0hArkr79dHuVvhFLhs3GaU9+Tw7WpJWV/2SQIIA4bIpJbU85tK1Gg6IkLojgKtoV664kWbc+oQYRRpwh0DHZLQJztGM6LOh3T9oYcRBjrZ2F9ADYJGIFcZg9bxPFy/Y2DCCOqxe2tpHd7cwAbp3G6TVDh9mBlPp1h+va6rC4bC/NfWIQJWIQJWIQJWIRxOUpfQ+jqXwPuQ7IAAAAASUVORK5CYII=)";
} else {
ExternalAppBtn.style.listStyleImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA6SURBVDhPYxgcIDg+6z8IQ7lwPiEMVT4YDBh4gO4kZGfiw1Dlg8GAgQfoTkJ2Jj4MVT4YDCAfMDAAAFSm42US1bMnAAAAAElFTkSuQmCC)";
}
if (Appmenu.isUrlbar === 1) {
var navBar = document.getElementById("nav-bar-customization-target");
navBar.insertBefore(ExternalAppBtn, navBar.firstChild);
} else if (Appmenu.isUrlbar === 2) {
var menubar = document.getElementById("toolbar-menubar");
menubar.insertBefore(ExternalAppBtn, menubar.firstChild);
} else {
var TabsToolbar = document.getElementById("TabsToolbar");
TabsToolbar.insertBefore(ExternalAppBtn, TabsToolbar.firstChild);
}
var ExternalAppPopup = document.createElementNS(XULNS, 'menupopup');
//ExternalAppPopup.setAttribute('onpopupshowing', 'event.stopPropagation(); Appmenu.onpopupshowing();');
ExternalAppPopup.addEventListener('click', event => {
event.stopPropagation();
});
ExternalAppPopup.setAttribute('id', 'AMpopup');
this._externalAppPopup = ExternalAppPopup;
ExternalAppBtn.appendChild(ExternalAppPopup);
Appmenu.onpopupshowing();
// Menü mit Tastaturkürzel öffnen
/* if (Appmenu.hotkey) {
let key = document.createXULElement('key');
key.id = 'key_AppMenuPopup';
key.setAttribute('key', Appmenu.hotkey);
if (Appmenu.hotkeyModifier)
key.setAttribute('modifiers', Appmenu.hotkeyModifier);
key.setAttribute('oncommand', 'document.getElementById("AMpopup").openPopup();');
document.getElementById('mainKeyset').appendChild(key);
} */
},
onpopupshowing: function() {
if (this._isready)
return;
if (this._externalAppPopup === null)
return;
var ExternalAppPopup = this._externalAppPopup;
for (let subdir of this.toolbar.subdirs) {
if (subdir.name == 'separator') {
ExternalAppPopup.appendChild(document.createXULElement('menuseparator'));
} else {
var subdirItem = ExternalAppPopup.appendChild(document.createXULElement('menu'));
var subdirItemPopup = subdirItem.appendChild(document.createXULElement('menupopup'));
subdirItem.setAttribute('class', 'menu-iconic');
subdirItem.setAttribute('label', subdir.name);
subdirItem.setAttribute('image', subdir.image);
Appmenu.subdirPopupHash[subdir.name] = subdirItemPopup;
Appmenu.subdirMenuHash[subdir.name] = subdirItem;
}
}
for (let app of this.toolbar.apps) {
var appItem;
if (app.name == 'separator') {
appItem = document.createXULElement('menuseparator');
} else {
appItem = document.createXULElement('menuitem');
appItem.setAttribute('class', 'menuitem-iconic');
appItem.setAttribute('label', app.name);
appItem.setAttribute('image', app.image);
//appItem.setAttribute('oncommand', "Appmenu.exec(this.path, this.args);");
appItem.addEventListener('command', function () {
Appmenu.exec(this.path, this.args);
});
appItem.setAttribute('tooltiptext', app.name);
appItem.path = app.path;
appItem.args = app.args;
}
if (app.subdir && Appmenu.subdirPopupHash[app.subdir])
Appmenu.subdirPopupHash[app.subdir].appendChild(appItem);
else ExternalAppPopup.appendChild(appItem);
}
for (let config of this.toolbar.configs) {
var configItem;
if (config.name == 'separator') {
configItem = document.createXULElement('menuseparator');
} else {
configItem = ExternalAppPopup.appendChild(document.createXULElement('menuitem'));
configItem.setAttribute('class', 'menuitem-iconic');
configItem.setAttribute('label', config.name);
configItem.setAttribute('image', config.image);
//configItem.setAttribute('oncommand', config.command);
configItem.addEventListener('command', () => {
eval(config.command);
});
if (config.tooltiptext) {
configItem.setAttribute('tooltiptext', config.tooltiptext);
} else {
configItem.setAttribute('tooltiptext', config.name);
}
configItem.setAttribute('id', config.id);
}
if (config.subdir && Appmenu.subdirPopupHash[config.subdir]) {
Appmenu.subdirPopupHash[config.subdir].appendChild(configItem);
} else {
ExternalAppPopup.appendChild(configItem);
}
}
if (this.autohideEmptySubDirs) {
for (let i = 0; i < Appmenu.subdirPopupHash.length; i++) {
if (Appmenu.subdirPopupHash[i].hasChildNodes()) {
continue;
} else {
Appmenu.subdirMenuHash[i].setAttribute("hidden", "true");
}
}
}
if (this.moveSubDirstoBottom) {
let i = ExternalAppPopup.childNodes.length;
while (ExternalAppPopup.firstChild.getAttribute('class') != 'menuitem-iconic' && i-- != 0) {
ExternalAppPopup.appendChild(ExternalAppPopup.firstChild);
}
}
this._isready = true;
},
handleRelativePath: function(apps) {
for (let app of apps) {
if (app.path) {
app.path = app.path.replace(/\//g, '\\');
var ffdir = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get(app.root, Ci.nsIFile).path;
if (/^(\\)/.test(app.path)) {
app.path = ffdir + app.path;
}
}
}
},
exec: function(path, args) {
args = args || [];
var args_t = args.slice(0);
for (let arg of args_t) {
arg = arg.replace(/%u/g, gBrowser.currentURI.spec);
}
var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
file.initWithPath(path);
if (!file.exists()) {
//Cu.reportError('Datei nicht gefunden: ' + path);
alert('Datei nicht gefunden: ' + path);
return;
}
if (file.isExecutable() && !path.endsWith('.js')) {
var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
process.init(file);
process.run(false, args_t, args_t.length);
} else if (file.isFile()) {
if (this.editor) {
let UI = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
UI.charset = window.navigator.platform.toLowerCase().includes('win') ? 'Shift_JIS' : 'UTF-8';
let path = UI.ConvertFromUnicode(file.path);
let app = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
app.initWithPath(this.editor);
let process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
process.init(app);
process.run(false, [path], 1);
} else {
file.launch();
}
} else if (file.isDirectory()) {
if (this.fileManager) {
let args=[this.FMParameter,path];
let app = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
app.initWithPath(this.fileManager);
let process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
process.init(app);
process.run(false, args, args.length);
} else {
file.launch();
}
}
},
};
if (window.gBrowser)
Appmenu.init();
// _AppMenuButtonMoveable.js
(function() {
if (location != 'chrome://browser/content/browser.xhtml')
return;
var appButton = document.getElementById('AppMenuButton');
if (!CustomizableUI.getPlacementOfWidget('MoverAppMenuButton')) {
try {
CustomizableUI.createWidget({
id: 'MoverAppMenuButton',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbaritem');
toolbaritem.id = 'MoverAppMenuButton';
toolbaritem.className = 'chromeclass-toolbar-additional';
toolbaritem.setAttribute('label', 'Firefox Starter');
return toolbaritem;
}
});
if (!CustomizableUI.getPlacementOfWidget('MoverAppMenuButton')) {
menuButton.style.display = 'none';
return;
};
} catch(e) {
menuButton.style.display = 'none';
return;
};
};
setTimeout(function() {
document.getElementById('MoverAppMenuButton').appendChild(appButton);
appButton.setAttribute('consumeanchor', 'MoverAppMenuButton');
appButton.setAttribute('label', 'Firefox Starter');
appButton.setAttribute('tooltiptext', 'Firefox Starter');
}, 0);
}());
Alles anzeigen
aber dann liegt es doch an "Deinem" Skript, dass das Skript zum "kopieren"
der Menüleiste nicht richtig eingebunden wird.
Nein, erst mit meinem (letzter Teil) funktioniert es.
Komme erst in drei Wochen dazu, mich hier wieder zu kümmern.
Keine Panik, in der Ruhe lie...........![]()
![]()
Hier funktioniert es!
Alle drei Skripte, absolut ohne Probleme.
Hier leider nicht, erst wenn ich aus meinem Script den letzten Teil ab hier _externalAppPopup: null, ersetze. Dann funktioniert es, muss natürlich auch angepasst werden.
Habe ja das Appmenü komplett abgespeckt.
Es bestehen ja nur noch zwei Untermenüs
und zwar "Firefox Verzeichnisse" und "Firefox Funktionen".
Abgeteilt darunter der Menüpunkt "Neustart" und "Beenden".
Danke, habe ich mal installiert, wird angezeigt, ist aber für Nightly nicht angepasst, da keine Reaktion.
Ich hattee mir extra Firefox 135 Beta 9 neu heruntergeladen, da ich ansonsten überhaupt keine Beta-Version nutze, und das Update auf den RC 1 getestet.
Ist alles gut möglich, eine Version hat keinerlei Anpassungen erhalten, und trotzdem trat das Problem hier auf.
Hinzufügen muss ich aber, Beta-Versionen verwende ich nur als portable. Ob das jetzt ursächlich dafür ist, kann ich nicht nachvollziehen.
Ein Restart per Skript reicht dafür nicht aus.
Siehst Du, darauf habe ich noch nicht geachtet. Aber trotzdem ist da wohl etwas Sand im Getriebe.
Kann das jemand bestätigen?
Sorry, Andreas, das habe ich jetzt erst gelesen. Genau so verhält es sich, auch beim heutigen Update auf 135.0.![]()
Das geht nun schon eine Weile so, aber komisch ist schon, irgendwann bietet er trotzdem das nächst höhere Update an.