- Firefox-Version
- Firefox 136 Beta
- Betriebssystem
- Windows 10 pro
Leider funktioniert dieses für mich sehr wichtige Script ab Firefox 136 Beta nicht mehr.
JavaScript
// ==UserScript==
// @name externalApplications.uc.js
// @namespace ithinc#mozine.cn
// @description External Applications
// @include main
// @compatibility Firefox 3.5.x 3.6.x 17.01
// @author ithinc
// @Version Fix by aborix
// @Version 20190108.2.0.0 Frei verschiebbare Schaltflächen von aborix
// @version 20091216.1.0.0 Final release
// @version 20091215.0.0.2 Handle toolbar apps and menu apps separately
// @version 20091212.0.0.1 Initial release
// ==/UserScript==
/* :::: External Applications :::: */
var gExternalApplications = {
toolbar: {
apps: [
{name: 'Wetter', path: 'C:\\Users\\xxxx\\Wetter'},
{name: 'Notepad++', path: 'C:\\Program Files\\Notepad++\\notepad++.exe'},
{name: 'Microsoft Outlook', path: 'C:\\Program Files (x86)\\Microsoft Office\\OFFICE14\\Outlook.exe'},
{name: 'Videolan Player', path: 'C:\\Program Files\\VideoLAN\\VLC\\vlc.exe'},
{name: 'Windows Explorer', path: 'C:\\Windows\\explorer.exe'},
{name: 'WinMergeU', path: 'F:\\Adaten\\Downloads\\Freecomander\\WinMerge-2.14.0\\WinMerge-2.16.12-x64-exe\\WinMerge\\WinMergeU.exe'},
{name: 'Filezilla', path: 'F:\\Adaten\\Downloads\\Filezilla\\FileZilla_3.10.3_win64\\FileZilla-3.56.2\\filezilla.exe'},
{name: 'CarotDAV', path: 'F:\\Adaten\\Downloads\\Dropbox\\CarotDAV1.9.9.portable\\CarotDAV\\CarotDAV.exe'},
{name: 'Pickpick', path: 'F:\\Adaten\\Downloads\\picpick\\picpick.exe'},
{name: 'Profilmanager', path: 'F:\\Adaten\\Downloads\\Firefox\\Profile-Manager\\profilemanager.exe'},
{name: 'Profile', path: 'C:\\Users\\xxxx\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles'},
{name: 'FreeCommander', path: 'F:\\Adaten\\Downloads\\FreeComander\\FreeCommanderPortable\\FreeCommanderPortable.exe'},
{name: 'TV Browser', path: 'F:\\Adaten\\Downloads\\TVBrowser\\tvbrowser_3.2.1_bin_transportable\\tvbrowser-transportable\\tvbrowser-transportable.exe'},
{name: 'Radio Sure', path: 'F:\\Adaten\\Downloads\\Radio\\RadioSure.exe'},
]
},
// Menü für Firefox Extras - Externe Anwendungen
menu: {
apps: [
{name: 'Notepad', path: 'C:\\WINDOWS\\system32\\notepad.exe'},
{name: 'Rechner', path: 'C:\\WINDOWS\\system32\\calc.exe'},
{name: 'DOS', path: 'C:\\WINDOWS\\system32\\cmd.exe'},
{name: 'separator'},
{name: 'UltraSearch', path: 'F:\\Adaten\\Downloads\\FreeComander\\UltraSearch\\UltraSearch.exe'},
{name: 'CarotDAV', path: 'F:\\Adaten\\Downloads\\Dropbox\\CarotDAV1.9.9.portable\\CarotDAV\\CarotDAV.exe'},
{name: 'Windows Explorer', path: 'c:\\windows\\explorer.exe'},/*x?????*/
{name: 'Internet Explorer', path: 'C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE', args: ['%u']},
{name: 'Firefox', path: 'F:\\Adaten\\Downloads\\Firefox'},
{name: 'Videos', path: 'F:\\Video'},
{name: 'Videos2', path: 'F:\\Adaten\\Müll'},
],
id: 'ExternalApplicationsMenu',
insertafter: 'menu_openAddons', // 'helpMenu', 'tools-menu' oder 'browserToolsSeparator'
label: 'Externe Anwendungen',
accesskey: 'A'
},
init: function() {
this.handleRelativePath(this.toolbar.apps);
this.handleRelativePath(this.menu.apps);
this.createToolbarbuttons(this.toolbar.apps);
if (this.menu.apps.length > 0) {
var refNode = document.getElementById(this.menu.insertafter);
if (refNode) {
var menu = refNode.parentNode.insertBefore(document.createXULElement('menu'), refNode.nextSibling);
menu.setAttribute('id', this.menu.id);
menu.setAttribute('label', this.menu.label);
menu.setAttribute('accesskey', this.menu.accesskey);
menu.appendChild(this.createMenupopup(this.menu.apps));
}
}
},
handleRelativePath: function(apps) {
for (var i=0; i<apps.length; i++) {
var app = apps[i];
if (app.path) {
app.path = app.path.replace(/\//g, '\\');
var ffdir = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('CurProcD', Ci.nsIFile).path;
if (/^(\.)/.test(app.path)) {
app.path = ffdir + '\\' + app.path;
}
else if (/^(\\)/.test(app.path)) {
app.path = ffdir.substr(0,2) + app.path;
}
}
}
},
exec: function(path, args) {
args = 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()) {
Cu.reportError('File Not Found: ' + path);
return;
}
if (!file.isExecutable()) {
file.launch();
}
else {
var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
process.init(file);
process.run(false, args, args.length);
}
},
createToolbarbuttons: function(apps) {
for (var i=0; i<apps.length; i++) {
var app = apps[i];
if (app.name != 'separator') {
createButton(app);
}
};
function createButton(app) {
var buttonId = app.name.replace(/ /g, '_').replace(/\+/g, 'Plus') + '-ExtApp-button';
try {
CustomizableUI.createWidget({
id: buttonId,
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
var attributes = {
id: buttonId,
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
label: app.name,
tooltiptext: app.name,
image: 'moz-icon:file:///' + app.path + '?size=16',
oncommand: 'gExternalApplications.exec(this.path, this.args);',
//style: 'margin: 0px 0px; background: none; box-shadow: none; border-color: transparent;' // dawlen add
};
for (var a in attributes) {
toolbaritem.setAttribute(a, attributes[a]);
};
toolbaritem.path = app.path;
toolbaritem.args = app.args;
return toolbaritem;
}
});
CustomizableUI.registerToolbarNode(tb);
} catch(e) {};
}
},
createMenupopup: function(apps) {
var menupopup = document.createXULElement('menupopup');
for (var i=0; i<apps.length; i++) {
var app = apps[i];
if (app.name == 'separator') {
menupopup.appendChild(document.createXULElement('menuseparator'));
}
else {
var item = menupopup.appendChild(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.path = app.path;
item.args = app.args;
}
}
return menupopup;
}
};
gExternalApplications.init();
Alles anzeigen
Habe es so zu ändern versucht aber das funktioniert nicht.
JavaScript
// ==UserScript==
// @name externalApplications.uc.js
// @namespace ithinc#mozine.cn
// @description External Applications
// @include main
// @compatibility Firefox 3.5.x 3.6.x 17.01
// @author ithinc
// @Version Fix by aborix
// @Version 20190108.2.0.0 Frei verschiebbare Schaltflächen von aborix
// @version 20091216.1.0.0 Final release
// @version 20091215.0.0.2 Handle toolbar apps and menu apps separately
// @version 20091212.0.0.1 Initial release
// ==/UserScript==
/* :::: External Applications :::: */
var gExternalApplications = {
toolbar: {
apps: [
{name: 'Wetter', path: 'C:\\Users\\xxxx\\Wetter'},
{name: 'Notepad++', path: 'C:\\Program Files\\Notepad++\\notepad++.exe'},
{name: 'Microsoft Outlook', path: 'C:\\Program Files (x86)\\Microsoft Office\\OFFICE14\\Outlook.exe'},
{name: 'Videolan Player', path: 'C:\\Program Files\\VideoLAN\\VLC\\vlc.exe'},
{name: 'Windows Explorer', path: 'C:\\Windows\\explorer.exe'},
{name: 'WinMergeU', path: 'F:\\Adaten\\Downloads\\Freecomander\\WinMerge-2.14.0\\WinMerge-2.16.12-x64-exe\\WinMerge\\WinMergeU.exe'},
{name: 'Filezilla', path: 'F:\\Adaten\\Downloads\\Filezilla\\FileZilla_3.10.3_win64\\FileZilla-3.56.2\\filezilla.exe'},
{name: 'CarotDAV', path: 'F:\\Adaten\\Downloads\\Dropbox\\CarotDAV.portable\\CarotDAV\\CarotDAV.exe'},
{name: 'Pickpick', path: 'F:\\Adaten\\Downloads\\picpick\\picpick.exe'},
{name: 'Profilmanager', path: 'F:\\Adaten\\Downloads\\Firefox\\Profile-Manager\\profilemanager.exe'},
{name: 'Profile', path: 'C:\\Users\\xxxx\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles'},
{name: 'FreeCommander', path: 'F:\\Adaten\\Downloads\\FreeComander\\FreeCommanderPortable\\FreeCommanderPortable.exe'},
{name: 'TV Browser', path: 'F:\\Adaten\\Downloads\\TVBrowser\\tvbrowser_3.2.1_bin_transportable\\tvbrowser-transportable\\tvbrowser-transportable.exe'},
{name: 'Radio Sure', path: 'F:\\Adaten\\Downloads\\Radio\\RadioSure.exe'},
]
},
// Menü für Firefox Extras - Externe Anwendungen
menu: {
apps: [
{name: 'Notepad', path: 'C:\\WINDOWS\\system32\\notepad.exe'},
{name: 'Rechner', path: 'C:\\WINDOWS\\system32\\calc.exe'},
{name: 'DOS', path: 'C:\\WINDOWS\\system32\\cmd.exe'},
{name: 'separator'},
{name: 'UltraSearch', path: 'F:\\Adaten\\Downloads\\FreeComander\\UltraSearch\\UltraSearch.exe'},
{name: 'CarotDAV', path: 'F:\\Adaten\\Downloads\\Dropbox\\CarotDAV.portable\\CarotDAV\\CarotDAV.exe'},
{name: 'Windows Explorer', path: 'c:\\windows\\explorer.exe'},/*x?????*/
{name: 'Internet Explorer', path: 'C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE', args: ['%u']},
{name: 'Firefox', path: 'F:\\Adaten\\Downloads\\Firefox'},
{name: 'Videos', path: 'F:\\Video'},
{name: 'Videos2', path: 'F:\\Adaten\\Müll'},
],
id: 'ExternalApplicationsMenu',
insertafter: 'menu_openAddons', // 'helpMenu', 'tools-menu' oder 'browserToolsSeparator'
label: 'Externe Anwendungen',
accesskey: 'A'
},
init: function() {
this.handleRelativePath(this.toolbar.apps);
this.handleRelativePath(this.menu.apps);
this.createToolbarbuttons(this.toolbar.apps);
if (this.menu.apps.length > 0) {
var refNode = document.getElementById(this.menu.insertafter);
if (refNode) {
var menu = refNode.parentNode.insertBefore(document.createXULElement('menu'), refNode.nextSibling);
menu.setAttribute('id', this.menu.id);
menu.setAttribute('label', this.menu.label);
menu.setAttribute('accesskey', this.menu.accesskey);
menu.appendChild(this.createMenupopup(this.menu.apps));
}
}
},
handleRelativePath: function(apps) {
for (var i=0; i<apps.length; i++) {
var app = apps[i];
if (app.path) {
app.path = app.path.replace(/\//g, '\\');
var ffdir = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('CurProcD', Ci.nsIFile).path;
if (/^(\.)/.test(app.path)) {
app.path = ffdir + '\\' + app.path;
}
else if (/^(\\)/.test(app.path)) {
app.path = ffdir.substr(0,2) + app.path;
}
}
}
},
exec: function(path, args) {
args = 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()) {
Cu.reportError('File Not Found: ' + path);
return;
}
if (!file.isExecutable()) {
file.launch();
}
else {
var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
process.init(file);
process.run(false, args, args.length);
}
},
createToolbarbuttons: function(apps) {
for (var i=0; i<apps.length; i++) {
var app = apps[i];
if (app.name != 'separator') {
createButton(app);
}
};
function createButton(app) {
var buttonId = app.name.replace(/ /g, '_').replace(/\+/g, 'Plus') + '-ExtApp-button';
try {
CustomizableUI.createWidget({
id: buttonId,
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
var attributes = {
id: buttonId,
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
label: app.name,
tooltiptext: app.name,
image: 'moz-icon:file:///' + app.path + '?size=16',
//oncommand: 'gExternalApplications.exec(this.path, this.args);',
};
for (var a in attributes) {
toolbaritem.setAttribute(a, attributes[a]);
toolbaritem.addEventListener('command', event => {
if (event.button == 0) {
gExternalApplications.exec(this.path, this.args);
}
});
toolbaritem.path = app.path;
toolbaritem.args = app.args;
return toolbaritem;
}
}
});
} catch(e) {};
}
},
createMenupopup: function(apps) {
var menupopup = document.createXULElement('menupopup');
for (var i=0; i<apps.length; i++) {
var app = apps[i];
if (app.name == 'separator') {
menupopup.appendChild(document.createXULElement('menuseparator'));
}
else {
var item = menupopup.appendChild(document.createXULElement('menuitem'));
item.setAttribute('class', 'menuitem-iconic');
item.setAttribute('label', app.name);
item.setAttribute('image', 'moz-icon:file://' + app.path + '?size=16');
item.addEventListener ('command', function (event) {
if (event.button == 0) {
gExternalApplications.exec(this.path, this.args);
}
});
item.path = app.path;
item.args = app.args;
return menupopup;
}
}
},
};
gExternalApplications.init();
Alles anzeigen
Hat jemand von euch eine Idee?
Mfg.
Endor