userChrome.js Scripte für den Fuchs (Diskussion)
-
Endor -
12. Mai 2015 um 14:19 -
Erledigt
-
-
In FF 57 platziert Movefeedbuttontourlbar.uc.js das RSS-Icon rechts neben die Suchleiste und nicht in die Suchleiste ans rechte Ende wie in FF 56. Bekommt man das Icon wieder in die Suchleiste?
-
Leider nein.
Die Adressleiste kann im Moment nicht mehr angesprochen werden.
Keine Ahnung ob sich das nochmal ändern wird.Edit:
Geht anscheinend doch:
Teste mal dieses Script:Code
Alles anzeigen// Feed Button 0.1 (function () { if (location != 'chrome://browser/content/browser.xul') return; const buttonId = 'jprss-button'; const buttonLabel = 'RSS Button für Adressleiste'; const buttonTooltiptext = 'RSS Button für Adressleiste'; const buttonIcon = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAhNJREFUeNqkk9%2BLjGEUxz%2FPM%2B80Q1rmiqstm0K7dlOSRjbFBSGsK1ruiMTFti6sP0AoN4rcSO2FCyWxS42EMrhZrB9xMS0mwtXKMjtr5n1f53nPzPtOflzI6T095%2Bn9nu%2F5nvM8jwnDkImBnmLg%2B3lCH2SvZuQzupIsGhusTX3pOD2e89w%2B8Ov5Res2wsy02yjIWnGvxW2DRQpYQ6lwfZ6DRQRRUq4d1hxOqlQmoXQPXo7A24eQngUpgYcBrN6na0zgVAc1uHxA4jpk26BzK3RvU58sw%2FAuLeTU1GfiVr1mT4Q%2F4N19AQXK%2BPqGxuuPwYo9sFf2F7aAL7hgOh5KoqBegcHnSQsfJX5wFu6egM8vYNNJ6B%2BGi9sFW41hXjJhkTc6ID%2BlwuINsGQz7DgnBMdh%2FBI86Ybl%2FbBwlUArMYGNz8j1%2FuERvJeB3RqC83np%2FQ2sPQodvVA8pdCenVLke0N2TNBooVPkHRyDQ89gqSi4slv%2FrdwvWtNQLsKCZaKg2sxvELiJBt%2FkeI4kM%2BgdUmDpJszvEgLpdqIAmbmCr%2F6phRq%2FWSYjd%2BC2xmlPVarcXwjcMXriY2eSZBdn5wjJ7AZZVj3KEsXGtpyCTclPCT%2FdgWsFBaWk5za5rVOvYKRP4hx8lXi0T4ltC0EtNOXS1cft0cVpPiZj%2BKvJWwitnYpg7jUaY7qcSP7NfMl9GhH8j%2F0UYAByQLfCOoz1CQAAAABJRU5ErkJggg%3D%3D)'; var jprssIcon = { init: function() { var appcontent = document.getElementById("appcontent"); appcontent.addEventListener("pageshow", jprssIcon.onPageLoad, true); var container = gBrowser.tabContainer; container.addEventListener("TabSelect", jprssIcon.onPageLoad, false); }, onPageLoad: function(aEvent) { var feedButton = document.getElementById("jprss-button"); var feeds = gBrowser.selectedBrowser.feeds; feedButton.removeAttribute("feed"); if (feeds && feeds.length > 0) { feedButton.style.opacity = '1'; if (feeds.length == 1) { feedButton.setAttribute("feed", feeds[0].href); } } else { feedButton.style.opacity = '0.5'; } }, onFeedButtonClick: function(event) { event.stopPropagation(); if (event.target.hasAttribute("feed") && event.eventPhase == Event.AT_TARGET && (event.button == 0 || event.button == 1)) { FeedHandler.subscribeToFeed(null, event); } } }; var button = document.createElement('toolbarbutton'); button.id = buttonId; button.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional'); button.setAttribute('type', 'menu'); button.setAttribute('label', buttonLabel); button.setAttribute('tooltiptext', buttonTooltiptext); button.style.listStyleImage = buttonIcon; button.style.opacity = '0.5'; button.addEventListener('click', function(event) { return jprssIcon.onFeedButtonClick(event) }); var menupopup = document.createElement('menupopup'); menupopup.id = 'jprss-menu'; menupopup.setAttribute('onpopupshowing', 'return FeedHandler.buildFeedList(this)'); menupopup.setAttribute('oncommand', 'return FeedHandler.subscribeToFeed(null, event)'); menupopup.setAttribute('onclick', 'checkForMiddleClick(this, event)'); button.appendChild(menupopup); document.getElementById('page-action-buttons').insertBefore(button, document.getElementById('.autocomplete-history-dropmarker.urlbar-history-dropmarker')); var toolbars = document.getElementsByTagName('toolbar'); for (var i=0; i<toolbars.length; i++) { var currentset = toolbars[i].getAttribute('currentset'); if (currentset.split(',').indexOf(button.id) >= 0) { var j; if (i == 0) j = 1 else j = 0; toolbars[j].currentSet += ',' + button.id; toolbars[i].currentSet = currentset; }; }; var dropmarker = document.getAnonymousElementByAttribute(button, 'class', 'toolbarbutton-menu-dropmarker'); if (dropmarker) dropmarker.style.display = 'none'; window.addEventListener('DOMContentLoaded', function() { jprssIcon.init(); }, false); }) ();
Edit2
Hier das von Dir verwendete Script:CSS
Alles anzeigen// Feed Button 0.5 (function () { if (location != 'chrome://browser/content/browser.xul') return; const buttonLabel = 'RSS Button für Adressleiste'; const buttonTooltiptext = 'RSS Button für Adressleiste'; const buttonIcon = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAhNJREFUeNqkk9%2BLjGEUxz%2FPM%2B80Q1rmiqstm0K7dlOSRjbFBSGsK1ruiMTFti6sP0AoN4rcSO2FCyWxS42EMrhZrB9xMS0mwtXKMjtr5n1f53nPzPtOflzI6T095%2Bn9nu%2F5nvM8jwnDkImBnmLg%2B3lCH2SvZuQzupIsGhusTX3pOD2e89w%2B8Ov5Res2wsy02yjIWnGvxW2DRQpYQ6lwfZ6DRQRRUq4d1hxOqlQmoXQPXo7A24eQngUpgYcBrN6na0zgVAc1uHxA4jpk26BzK3RvU58sw%2FAuLeTU1GfiVr1mT4Q%2F4N19AQXK%2BPqGxuuPwYo9sFf2F7aAL7hgOh5KoqBegcHnSQsfJX5wFu6egM8vYNNJ6B%2BGi9sFW41hXjJhkTc6ID%2BlwuINsGQz7DgnBMdh%2FBI86Ybl%2FbBwlUArMYGNz8j1%2FuERvJeB3RqC83np%2FQ2sPQodvVA8pdCenVLke0N2TNBooVPkHRyDQ89gqSi4slv%2FrdwvWtNQLsKCZaKg2sxvELiJBt%2FkeI4kM%2BgdUmDpJszvEgLpdqIAmbmCr%2F6phRq%2FWSYjd%2BC2xmlPVarcXwjcMXriY2eSZBdn5wjJ7AZZVj3KEsXGtpyCTclPCT%2FdgWsFBaWk5za5rVOvYKRP4hx8lXi0T4ltC0EtNOXS1cft0cVpPiZj%2BKvJWwitnYpg7jUaY7qcSP7NfMl9GhH8j%2F0UYAByQLfCOoz1CQAAAABJRU5ErkJggg%3D%3D)'; var feedButton = document.getElementById('feed-button'); if (!feedButton) { window.CustomizableUI.addWidgetToArea('feed-button','nav-bar'); feedButton = document.getElementById('feed-button'); }; feedButton.setAttribute('label', buttonLabel); feedButton.setAttribute('tooltiptext', buttonTooltiptext); feedButton.style.listStyleImage = buttonIcon; feedButton.style.MozImageRegion = 'rect(0px 24px 24px 0px)'; var urlbarIcons = document.getElementById('page-action-buttons'); urlbarIcons.appendChild(feedButton); var css = '#feed-button .toolbarbutton-icon {padding: 0px !important; margin-bottom: -2px!important;} #feed-button {margin-top: 3px !important; margin-bottom: -4px !important;} #feed-button[disabled]{display: none !important;}'; var stylesheet = document.createProcessingInstruction('xml-stylesheet', 'type="text/css" href="data:text/css;utf-8,' + encodeURIComponent(css) + '"'); document.insertBefore(stylesheet, document.documentElement); }) ();
Müsste so nun auch wieder funktionieren.
Mfg.
Endor
Mfg.
Endor -
Funktioniert wieder. Besten Dank.
-
ich hab da was gefunden auf/in GitHub "setCurrentProfileNameToTitlebar.uc.js"
könnte das auch in Fx Nightly 58.0a1 gehen? (da mein Addon (Add-ons) dafür nicht mehr geht)
vielleicht für die Menüleiste!?
Teste folgendes Skript, du kannst das Ding in den Leisten (fast) beliebig verschieben:
Code
Alles anzeigen(function() { if (location != 'chrome://browser/content/browser.xul') return; function getCurrentProfileName(){ function readFile(aFile){ var stream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream); stream.init(aFile, 0x01, 0, 0); var cvstream = Cc["@mozilla.org/intl/converter-input-stream;1"].createInstance(Ci.nsIConverterInputStream); cvstream.init(stream, "UTF-8", 1024, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); var content = "", data = {}; while (cvstream.readString(4096, data)) { content += data.value; } cvstream.close(); return content.replace(/\r\n?/g, "\n"); } var PrefD = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("PrefD", Components.interfaces.nsIFile); var ini = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("AppRegD", Components.interfaces.nsIFile); ini.append("profiles.ini"); var ini = readFile(ini); var profiles = ini.match(/Name=.+/g); var profilesD = ini.match(/Path=.+/g); for ( var i = 0; i < profiles.length;i++) { if ((profilesD[i]+"$").indexOf(PrefD.leafName+"$") >= 0) { profiles[i].match(/Name=(.+)$/); return RegExp.$1; } } return null; }; try { CustomizableUI.createWidget({ id: 'profile-name', type: 'custom', defaultArea: CustomizableUI.AREA_MENUBAR, onBuild: function(aDocument) { var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbaritem'); toolbaritem.id = 'profile-name'; toolbaritem.className = 'chromeclass-toolbar-additional'; toolbaritem.setAttribute('label', 'Profil-Name'); var label = document.createElement('label'); label.setAttribute('value', getCurrentProfileName()); toolbaritem.appendChild(label); return toolbaritem; } }); } catch(e) { }; })();
-
:klasse: funzt
jetzt muss ich nur noch herausfinden wie ich das "zentrieren" kann im "Code"
weil dat "klemmt" jetzt oben unter der Kante
[Blockierte Grafik: http://fs5.directupload.net/images/171001/86gvrn43.png]
uni
-
-
Müsste jetzt auch mit dem Script passen. Hoffe ich wenigstens.
Habe unten einen Absatz eingefügt:CSS
Alles anzeigen(function() { if (location != 'chrome://browser/content/browser.xul') return; function getCurrentProfileName(){ function readFile(aFile){ var stream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream); stream.init(aFile, 0x01, 0, 0); var cvstream = Cc["@mozilla.org/intl/converter-input-stream;1"].createInstance(Ci.nsIConverterInputStream); cvstream.init(stream, "UTF-8", 1024, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); var content = "", data = {}; while (cvstream.readString(4096, data)) { content += data.value; } cvstream.close(); return content.replace(/\r\n?/g, "\n"); } var PrefD = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("PrefD", Components.interfaces.nsIFile); var ini = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("AppRegD", Components.interfaces.nsIFile); ini.append("profiles.ini"); var ini = readFile(ini); var profiles = ini.match(/Name=.+/g); var profilesD = ini.match(/Path=.+/g); for ( var i = 0; i < profiles.length;i++) { if ((profilesD[i]+"$").indexOf(PrefD.leafName+"$") >= 0) { profiles[i].match(/Name=(.+)$/); return RegExp.$1; } } return null; }; try { CustomizableUI.createWidget({ id: 'profile-name', type: 'custom', defaultArea: CustomizableUI.AREA_MENUBAR, onBuild: function(aDocument) { var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbaritem'); toolbaritem.id = 'profile-name'; toolbaritem.className = 'chromeclass-toolbar-additional'; toolbaritem.setAttribute('label', 'Profil-Name'); var label = document.createElement('label'); label.setAttribute('value', getCurrentProfileName()); toolbaritem.appendChild(label); return toolbaritem; } }); } catch(e) { return }; var css = '\ @-moz-document url("chrome://browser/content/browser.xul") { \ #profile-name {margin-top: 3px; margin-bottom: -2px !important; font-weight: bold; font-size: 14px;\ } \ }'; var cssUri = Services.io.newURI('data:text/css,' + encodeURIComponent(css), null, null); var SSS = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService); SSS.loadAndRegisterSheet(cssUri, SSS.AUTHOR_SHEET); })();
Werte dann noch nach Wunsch anpassen.
Mfg.
Endor -
-
Teste am besten das neue Script, erspart wenn dann einen css Code.
-
das von Endor also
ich teste mal
bis gleich
uni
-
Hier funktioniert es einwandfrei.
-
:klasse:
hab das auf "Developer Beta" probiert
werde jetzt dann die anderen "Profile" nachziehen
uni
ot
nebenbei
:shock: schaue nach
dat is ja jetzt "Quantum"
ot ende
-
dat is ja jetzt "Quantum"
Richtig :wink:https://www.soeren-hentzschel.at/firefox/firefo…-ram-verbrauch/
-
Kleine Bemerkung zum Skript aus #948:
Zeile 49:
Zitat
} catch(e) { };würde ich so abändern:
Bei mehreren Fenstern wird der CSS-Teil dann nur im ersten Fenster ausgeführt, was in diesem Fall genügt. Hat man ohnehin nur ein Fenster, ist es egal.
-
Hallo aborix.
Vielen Dank.
Ist oben jetzt geändert.
Mfg.
Endor -
[Blockierte Grafik: http://www.smilies.4-user.de/include/Schilder/smilie_m_010.gif]
hab da mal wieder eine kleine Bastelaufgabe
gefunden auf github.com-ardiman
ExternalApplications_Extended.uc.js *siehe Bild
Code
Alles anzeigen// ==UserScript== // @name externalApplications.uc.js // @namespace ithinc#mozine.cn // @description External Applications // @include main // @compatibility Firefox 3.5.x 3.6.x // @author ithinc // @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: 'Notepad', path: '/WINDOWS/system32/notepad.exe'}, {name: 'Calculator', path: 'C:\\WINDOWS\\system32\\calc.exe'}, {name: 'freegate', path: 'F:\\360download\\fg709a.exe'}, //{name: 'separator'}, {name: 'Internet Explorer', path: 'C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE', args: ['%u']}, //{name: 'Command Prompt', path: 'C:\\WINDOWS\\system32\\cmd.exe'}, ], insertafter: 'menubar-items' //'menubar-items' or 'home-button' }, menu: { apps: [ //{name: 'Notepad', path: '/WINDOWS/system32/notepad.exe'}, {name: 'Calculator', path: 'C:\\WINDOWS\\system32\\calc.exe'}, //{name: 'Command Prompt', path: 'C:\\WINDOWS\\system32\\cmd.exe'}, //{name: 'separator'}, //{name: 'UltraEdit', path: 'C:\\Program Files\\IDM Computer Solutions\\UltraEdit-32\\uedit32.exe'}, //{name: 'Total Commander', path: 'U:\\Programs\\Total Commander\\TOTALCMD.EXE'}, //{name: 'separator'}, //{name: 'My Computer', path: 'c:\\windows\\explorer.exe'},/*x?????*/ {name: 'Internet Explorer', path: 'C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE', args: ['%u']},//??????????,????%u // {name: 'Maxthon', path: 'C:\\Program Files\\Maxthon\\Maxthon.exe', args: ['%u']}, // {name: 'Namoroka', path: 'D:\\Program Files\\Namoroka3.6b5pre\\firefox.exe', args: ['-no-remote', '-P blank']}, // {name: 'separator'}, //{name: 'Profile', path: 'C:\\Documents and Settings\\linus\\Application Data\\Mozilla\\Firefox\\Profiles\\c4r67s72.default'}, ], insertafter: 'browserToolsSeparator', //'helpMenu', 'tools-menu' or 'browserToolsSeparator' label: 'Start', accesskey: 'A' }, init: function() { this.handleRelativePath(this.toolbar.apps); this.handleRelativePath(this.menu.apps); if (this.toolbar.apps.length > 0) { var refNode = document.getElementById(this.toolbar.insertafter); if (refNode) { refNode.parentNode.insertBefore(this.createToolbaritem(this.toolbar.apps), refNode.nextSibling); } } if (this.menu.apps.length > 0) { var refNode = document.getElementById(this.menu.insertafter); if (refNode) { var menu = refNode.parentNode.insertBefore(document.createElement('menu'), refNode.nextSibling); 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++) { if (apps[i].path) { apps[i].path = apps[i].path.replace(/\//g, '\\'); var ffdir = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('CurProcD', Ci.nsIFile).path; if (/^(\.)/.test(apps[i].path)) { apps[i].path = ffdir + '\\' + apps[i].path; } else if (/^(\\)/.test(apps[i].path)) { apps[i].path = ffdir.substr(0,2) + apps[i].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.nsILocalFile); 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); } }, createToolbaritem: function(apps) { var toolbaritem = document.createElement('toolbaritem'); toolbaritem.setAttribute('class', 'chromeclass-toolbar-additional'); toolbaritem.setAttribute('orient', 'horizontal'); for (var i=0; i<apps.length; i++) { if (apps[i].name == 'separator') { toolbaritem.appendChild(document.createElement('toolbarseparator')); } else { var item = toolbaritem.appendChild(document.createElement('toolbarbutton')); item.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional'); item.setAttribute('label', apps[i].name); item.setAttribute('image', 'moz-icon:file://' + apps[i].path + '?size=16;'); item.setAttribute('oncommand', 'gExternalApplications.exec(this.path, this.args);'); item.setAttribute('tooltiptext', apps[i].name); item.setAttribute('style','margin: 0px 0px;background: none;box-shadow: none;border-color: transparent;'); //dawlen add item.path = apps[i].path; item.args = apps[i].args; } } return toolbaritem; }, createMenupopup: function(apps) { var menupopup = document.createElement('menupopup'); for (var i=0; i<apps.length; i++) { if (apps[i].name == 'separator') { menupopup.appendChild(document.createElement('menuseparator')); } else { var item = menupopup.appendChild(document.createElement('menuitem')); item.setAttribute('class', 'menuitem-iconic'); item.setAttribute('label', apps[i].name); item.setAttribute('image', 'moz-icon:file://' + apps[i].path + '?size=16'); item.setAttribute('oncommand', 'gExternalApplications.exec(this.path, this.args);'); item.path = apps[i].path; item.args = apps[i].args; } } return menupopup; } }; gExternalApplications.init();
oder das ewtl. ?
was würde besser gehen im Fx 57/58
externalApplications.uc.js
Code
Alles anzeigen// ==UserScript== // @name externalApplications.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: 'button', //'menu' or 'button' insertafter: 'menubar-items', apps: [ {name: 'Notepad', path: '/WINDOWS/system32/notepad.exe'}, {name: 'Calculator', path: '.\\.\\..\\..\\WINDOWS\\system32\\calc.exe'}, {name: 'Command Prompt', path: 'C:\\WINDOWS\\system32\\cmd.exe'}, {name: 'separator'}, {name: 'Internet Explorer', path: 'C:\\Programme\\Internet Explorer\\IEXPLORE.EXE', args: ['%u']}, {name: 'Maxthon', path: 'C:\\Program Files\\Maxthon\\Maxthon.exe', args: ['%u']}, ], 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 (this.type == 'menu') { var mainmenu = document.getElementById('main-menubar'); var menu = mainmenu.appendChild(document.createElement('menu')); menu.setAttribute('label', 'Start'); menu.setAttribute('accesskey', 'a'); var menupopup = menu.appendChild(document.createElement('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.createElement('toolbaritem'), menubarItems.nextSibling); 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.nsILocalFile); 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.createElement('toolbarseparator'); var item = document.createElement('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.setAttribute('tooltiptext', app.name); item.path = app.path; item.args = app.args; return item; }, createMenuitem: function(app) { if (app.name == 'separator') return document.createElement('menuseparator'); var item = document.createElement('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 item; } }; gExternalApplications.init();
*[Blockierte Grafik: http://fs5.directupload.net/images/171002/6d6isog3.jpg]
ich hätte gerne nur das Email "Symbol" (Thunderbird) wo der Pfeil hin zeigt
all meine versuche das zu starten sind fehlgeschlagen
hat zeit keine eile damit
(Nightly ist extra so groß gemacht von mir (Schrift))
gruß uni
-
Kannst das ja mal testen, den Pfad zu TB musst du dann anpassen:
Code
Alles anzeigen// ==UserScript== // @name Thunderbird.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: 'button', //'menu' or 'button' insertafter: 'urlbar-container', apps: [ {name: 'Thunderbird', path: "C:\\Program Files (x86)\\Mozilla Thunderbird\\thunderbird.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 (this.type == 'menu') { var mainmenu = document.getElementById('main-menubar'); var menu = mainmenu.appendChild(document.createElement('menu')); menu.setAttribute('label', 'Start'); menu.setAttribute('accesskey', 'a'); var menupopup = menu.appendChild(document.createElement('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.createElement('toolbaritem'), menubarItems.nextSibling); 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.nsILocalFile); 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.createElement('toolbarseparator'); var item = document.createElement('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.setAttribute('tooltiptext', app.name); item.path = app.path; item.args = app.args; return item; }, createMenuitem: function(app) { if (app.name == 'separator') return document.createElement('menuseparator'); var item = document.createElement('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 item; } }; gExternalApplications.init();
Leider ist der Button nicht verschiebbar und sollte bei dir hinter der Urlbar sein.
-
Hallo universum123.
Eine Schaltfläche alleine kannst Du da nicht verschieben.
Du hast ja mit dem Script drei Schaltflächen, die werden dann alle zusammen verschoben.
Oder hast Du bei Dir im Script nur den Thunderbird drinnen und sonst nichts?
Wenn dann müsstest Du uns schon Deine angepasste Version vom Script hier
einstellen.
Mfg.
Endor -
Kannst das ja mal testen, den Pfad zu TB musst du dann anpassen:
....Leider ist der Button nicht verschiebbar und sollte bei dir hinter der Urlbar sein.
genau das selbe hab ich auch gemacht*
dadurch erscheint dann garnix mehr
[Blockierte Grafik: http://www.cosgan.de/images/smilie/konfus/a050.gif]
uni
* das was Andreas gemacht hat habe ich auch schon getestet
wenn ich aber den "Pfad" vom Iexplorer gegen den vom Thunderbird tausche erscheint das *Bild aus #957
nur startet dann Thunderbird auch nicht
[Blockierte Grafik: http://www.cosgan.de/images/smilie/konfus/a050.gif]
-