Alle zusätzlichen Toolbars aus Aris-t2 scheinen in v140.0rc1 Probleme zu haben.
.........
Alle Toolbars außer addonbar_vertical.uc.js haben Probleme mit der Ausführung einiger eingebauter Firefox-Funktionen.
Würde mich immer noch interessieren, ob sowas hier die Button Probleme evtl. zumindest teilweise löst, falls es im Nightly überhaupt funktioniert:
(Sehr grobe Test Datei!).
JavaScript
//Toggle newtoolbar 7D_b rechts nav-bar test 14
(function() {
if (location.href !== 'chrome://browser/content/browser.xhtml')
return;
if (Services.prefs.getBoolPref('svg.context-properties.content.enabled') == false) {
Services.prefs.setBoolPref('svg.context-properties.content.enabled', true );
}
let ProfilePath = PathUtils.toFileURI(PathUtils.join(PathUtils.profileDir, 'chrome', 'icons'));
let icon1 = 'YourFolderIcon.svg';
let ImagePath = ProfilePath + icon1;
let toolbox_new = document.createXULElement('toolbox');
//toolbox_new.setAttribute('orient','horizontal');
toolbox_new.setAttribute('id','toolbox_new');
const element = document.getElementById("navigator-toolbox");
const rect = element.getBoundingClientRect();
//console.log("Width: " + rect.width + "px");
//console.log("Height: " + rect.height + "px");
let tb = document.createXULElement('toolbar');
//let tb_label = "New Toolbar";
tb.id = 'newtoolbar';
//tb.setAttribute("collapsed", "false");
tb.setAttribute('customizable', true);
tb.setAttribute("class","toolbar-primary chromeclass-toolbar browser-toolbar customization-target");
//tb.setAttribute('orient', 'horizontal');
tb.setAttribute('orient', 'vertical');
tb.setAttribute('mode', 'icons');
tb.setAttribute('context', 'toolbar-context-menu');
//tb.setAttribute("toolbarname", tb_label);
//tb.setAttribute("label", tb_label);
toolbox_new.appendChild(tb);
//Geht
document.getElementById('navigator-toolbox').appendChild(toolbox_new);
//Geht
//document.getElementById('nav-bar').appendChild(toolbox_new);
//geht #2
document.getElementById('toolbox_new').style.setProperty('--height_newbar', rect.height + 'px');
CustomizableUI.registerArea('newtoolbar', {legacy: true});
CustomizableUI.registerToolbarNode(tb);
try {
CustomizableUI.createWidget({
id: 'NewToolbar_button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
let currentProfileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile).path.replace(/\\/g, "/");
let buttonicon = "newtoolbar.png"
let toolbaritem = aDocument.createXULElement('toolbarbutton');
let props = {
id: 'NewToolbar_button',
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
removable: true,
label: 'Toggle New Toolbar',
tooltiptext: 'Toggle New toolbar',
//style: 'list-style-image: url("' + ("file:" + currentProfileDirectory + "/chrome/icons/" + buttonicon) + '");',
//style: 'list-style-image: url("chrome://browser/skin/sidebars-right.svg");',
};
for(let p in props)
toolbaritem.setAttribute(p, props[p]);
return toolbaritem;
}
});
} catch(e) { };
document.getElementById('NewToolbar_button').addEventListener( "click", newTB );
function newTB(aEvent, keyEvent=false) {
if(!keyEvent && aEvent.button != 0) {
return;
}
newtoolbar.classList.toggle("off-mode");
browser.classList.toggle("off-mode_b");
};
const css =`
:root {
--ug-newbar_width: 44px;
--ug-newbar_bg_color: lightblue;
}
#navigator-toolbox {
z-index: 444 !important;
}
/*
#nav-bar {
z-index: 4 !important;
}
*/
#browser:not(.off-mode_b) {
padding-right: var(--ug-newbar_width) !important;
}
#browser {
transition: padding 0.5s ease !important;
}
#toolbox_new {
position: fixed;
display: flex;
flex-direction: column;
bottom: 0;
/*left: 0;*/
right: 0;
}
#newtoolbar {
display: flex;
z-index: 4 !important;
width: var(--ug-newbar_width);
padding-block: 8px;
height: calc(100vh - var(--height_newbar));
background-color: var(--ug-newbar_bg_color) !important;
box-shadow: -1px 0 grey;
border-top: 1px solid grey;
transition: width 0.5s ease, margin 0.5s ease;
}
#newtoolbar:not([customizing]).off-mode {
margin-inline: 0 calc(0px - var(--ug-newbar_width));
box-shadow: none;
}
#newtoolbar .toolbarbutton-1 {
margin-block: 2px !important;
margin-inline: auto !important;
}
#NewToolbar_button .toolbarbutton-icon {
list-style-image: url("chrome://browser/skin/sidebars-right.svg") !important;
}
#newtoolbar[customizing] {
min-width: 0 !important;
}
#customization-container {
margin-inline: 0 var(--ug-newbar_width) !important;
}
`;
const sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
const uri = Services.io.newURI('data:text/css,' + encodeURIComponent(css));
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
})();
Alles anzeigen