Initial commit 2

This commit is contained in:
Cynthia Foxwell 2023-03-01 18:54:13 -07:00
parent e20a999b2c
commit e7b1999994
16 changed files with 3235 additions and 1 deletions

BIN
.assets/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -1,3 +1,35 @@
# MSFX
Fork of [the MSFX Firefox userChrome](https://github.com/WinClassic/MSFX).
![Screenshot of MSFX](.assets/screenshot.png)
Fork of the MSFX Firefox userChrome
## Changes
* Uses normal [firefox-scripts](https://github.com/xiaoxiaoflood/firefox-scripts) instead of a stripped down version for greater userscript compatibility
* More accurate styles in some places
* Bookmarks bar folder menus
* All tabs button
* Replaced with overflow arrows icon
* Scrollbars forced to light theme
* Selected address bar forced to light theme
* Resize grabber no longer appears when maximized
* Autoplay Pending indicator icon replaced
* Pinned tabs no longer have extra padding
* Internet status bar widget is its own component
* Empty boxes have been removed in favor of putting extensions on the status bar
* Address bar is no longer forced to the Address toolbar when opening a new window
## Installation
* Set the following keys in `about:config`:
* `svg.context-properties.content.enabled` to `true`
* `ui.prefersReducedMotion` to `1`
* `browser.display.windows.non_native_menus` to `0`
* Follow [firefox-scripts](https://github.com/xiaoxiaoflood/firefox-scripts) installation.
* Install [Status Bar userscript](https://raw.githubusercontent.com/xiaoxiaoflood/firefox-scripts/master/chrome/status-bar.uc.js).
* Merge `chrome` folder from the repo into your profile's `chrome` folder.
## Recommendations
* [Extensions Options Menu](https://raw.githubusercontent.com/xiaoxiaoflood/firefox-scripts/master/chrome/extensionOptionsMenu.uc.js)
* More lightweight than the stock extensions menu, which is disabled by the theme anyways
* [userChromeJS Manager](https://raw.githubusercontent.com/xiaoxiaoflood/firefox-scripts/master/chrome/rebuild_userChrome.uc.js)
* [Save File to](https://raw.githubusercontent.com/xiaoxiaoflood/firefox-scripts/master/extensions/savefileto/savefileto.xpi)
* **Requires extensions support in firefox-scripts**
* "Replaces" save dialog for hybrid classic theme setup with Windhawk until investigation is done to fix the save dialog on classic enabled programs.

View file

@ -0,0 +1,82 @@
// 'Activity throbber' script for Firefox 60+ by Aris
Components.utils.import("resource:///modules/CustomizableUI.jsm");
var { Services } = Components.utils.import(
"resource://gre/modules/Services.jsm",
{}
);
var sss = Components.classes[
"@mozilla.org/content/style-sheet-service;1"
].getService(Components.interfaces.nsIStyleSheetService);
var at_label = "Activity Throbber";
var ActivityThrobber = {
init: function () {
try {
document.addEventListener("TabAttrModified", _ActivityThrobber, false);
document.addEventListener("TabSelect", _ActivityThrobber, false);
document.addEventListener("TabOpen", _ActivityThrobber, false);
document.addEventListener("TabClose", _ActivityThrobber, false);
document.addEventListener("load", _ActivityThrobber, false);
// add or remove 'busy' tab from activity item
function _ActivityThrobber() {
if (gBrowser.selectedTab.hasAttribute("busy")) {
document
.querySelector("#activity_throbber")
.setAttribute("busy", "true");
} else
document.querySelector("#activity_throbber").removeAttribute("busy");
}
// create a default toolbar button
CustomizableUI.createWidget({
id: "activity_throbber", // button id
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: at_label, // button title
tooltiptext: at_label, // tooltip title
onCreated: function (button) {
return button;
},
});
// style button icon / embedded non-animated icon, because there is no image for then inside Fx anymore
var uri = Services.io.newURI(
"data:text/css;charset=utf-8," +
encodeURIComponent(
`#activity_throbber {
-moz-appearance: none !important;
list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJ1BMVEUAAAC0tLS0tLSysrK0tLS0tLS0tLS1tbW0tLS6urq0tLS3t7eurq4SF2bYAAAADXRSTlMA2oILm3RnVEEF0y4TZ0HrPwAAAE5JREFUCNdjAAIjZQYISBQDU1uUA0WNvIEMR/FDOoUiQIbiCgaGLiEgY3oDAwNHJQPDtGCQQtNMBkWQKJCEM+BSMMVw7XAD4VYgLIU7AwA5fBJ3rMaMkwAAAABJRU5ErkJggg==);
width: 16px !important;
height: 16px !important;
}
#activity_throbber *,
#activity_throbber:hover * {
-moz-appearance: none !important;
opacity: 1.0 !important;
box-shadow: unset !important;
background: unset !important;
}
#activity_throbber[busy] {
list-style-image: url("chrome://global/skin/media/throbber.png");
}
`
),
null,
null
);
// remove old style sheet, before registering the new one
if (sss.sheetRegistered(uri, sss.AGENT_SHEET)) {
sss.unregisterSheet(uri, sss.AGENT_SHEET);
}
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} catch (e) {
Components.utils.reportError(e);
}
},
};
document.addEventListener("DOMContentLoaded", ActivityThrobber.init(), false);

View file

@ -0,0 +1,218 @@
// 'Additional top toolbars' script for Firefox 60+ by Aris
// - "number_of_additional_top_toolbars": set the amount of additional top toolbar
// - "tb_label": set a toolbar name
// - use toolbar[id^="additional_top_toolbar"] {...} to affect all toolbars at once in CSS
// [!] Fix for WebExtensions with own windows by 黒仪大螃蟹 (for 1-N scripts)
//
// workaround on Fx 71 to save/restore toolbar visibility
// creating an observer array always fails, so observers are created manually atm.
Components.utils.import("resource:///modules/CustomizableUI.jsm");
var { Services } = Components.utils.import(
"resource://gre/modules/Services.jsm",
{}
);
var appversion = parseInt(Services.appinfo.version);
var AdditionalTopToolbars = {
init: function () {
/* blank tab workaround */
try {
if (gBrowser.selectedBrowser.getAttribute("blank"))
gBrowser.selectedBrowser.removeAttribute("blank");
} catch (e) {}
var number_of_additional_top_toolbars = 1; // max 5 to save toolbar state on Fx 71+ (add additional code at the bottom for more)
var tb_label = "Address";
try {
if (document.getElementById("additional_top_toolbar1") == null) {
if (
number_of_additional_top_toolbars > 0 &&
number_of_additional_top_toolbars < 6
) {
var i = 1;
while (i <= number_of_additional_top_toolbars) {
if (appversion <= 62)
var toptoolbar = document.createElement("toolbar");
else var toptoolbar = document.createXULElement("toolbar");
toptoolbar.setAttribute("id", "additional_top_toolbar" + i + "");
toptoolbar.setAttribute("toolbarname", tb_label + "");
toptoolbar.setAttribute("toolbarname", tb_label + "");
toptoolbar.setAttribute("customizable", "true");
toptoolbar.setAttribute(
"class",
"toolbar-primary chromeclass-toolbar browser-toolbar customization-target"
);
toptoolbar.setAttribute("mode", "icons");
toptoolbar.setAttribute("iconsize", "small");
toptoolbar.setAttribute("toolboxid", "navigator-toolbox");
toptoolbar.setAttribute("context", "toolbar-context-menu");
toptoolbar.setAttribute("lockiconsize", "true");
toptoolbar.setAttribute("defaultset", "spring");
document
.querySelector("#navigator-toolbox")
.appendChild(toptoolbar);
CustomizableUI.registerArea("additional_top_toolbar" + i + "", {
legacy: true,
});
if (appversion >= 65)
CustomizableUI.registerToolbarNode(toptoolbar);
// top toolbars 'collapsed' on startup
//setToolbarVisibility(toptoolbar, false);
try {
Services.prefs
.getDefaultBranch("browser.additional_top_toolbar" + i + ".")
.setBoolPref("enabled", true);
setToolbarVisibility(
document.getElementById("additional_top_toolbar" + i + ""),
Services.prefs
.getBranch("browser.additional_top_toolbar" + i + ".")
.getBoolPref("enabled")
);
} catch (e) {}
i++;
}
}
// CSS
var sss = Components.classes[
"@mozilla.org/content/style-sheet-service;1"
].getService(Components.interfaces.nsIStyleSheetService);
var uri = Services.io.newURI(
"data:text/css;charset=utf-8," +
encodeURIComponent(
'\
\
toolbar[id^="additional_top_toolbar"] { \
-moz-appearance: none !important; \
background-color: var(--toolbar-bgcolor); \
background-image: var(--toolbar-bgimage); \
background-clip: padding-box; \
color: var(--toolbar-color, inherit); \
} \
#main-window[customizing] toolbar[id^="additional_top_toolbar"] { \
outline: 1px dashed !important; \
outline-offset: -2px !important; \
} \
\
'
),
null,
null
);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
}
if (number_of_additional_top_toolbars >= 1) {
var observer1 = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
Services.prefs
.getBranch("browser.additional_top_toolbar1.")
.setBoolPref(
"enabled",
!document.querySelector("#additional_top_toolbar1").collapsed
);
});
});
observer1.observe(document.querySelector("#additional_top_toolbar1"), {
attributes: true,
childList: true,
characterData: true,
});
}
if (number_of_additional_top_toolbars >= 2) {
var observer2 = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
Services.prefs
.getBranch("browser.additional_top_toolbar2.")
.setBoolPref(
"enabled",
!document.querySelector("#additional_top_toolbar2").collapsed
);
});
});
observer2.observe(document.querySelector("#additional_top_toolbar2"), {
attributes: true,
childList: true,
characterData: true,
});
}
if (number_of_additional_top_toolbars >= 3) {
var observer3 = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
Services.prefs
.getBranch("browser.additional_top_toolbar3.")
.setBoolPref(
"enabled",
!document.querySelector("#additional_top_toolbar3").collapsed
);
});
});
observer3.observe(document.querySelector("#additional_top_toolbar3"), {
attributes: true,
childList: true,
characterData: true,
});
}
if (number_of_additional_top_toolbars >= 4) {
var observer4 = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
Services.prefs
.getBranch("browser.additional_top_toolbar4.")
.setBoolPref(
"enabled",
!document.querySelector("#additional_top_toolbar4").collapsed
);
});
});
observer4.observe(document.querySelector("#additional_top_toolbar4"), {
attributes: true,
childList: true,
characterData: true,
});
}
if (number_of_additional_top_toolbars >= 5) {
var observer5 = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
Services.prefs
.getBranch("browser.additional_top_toolbar5.")
.setBoolPref(
"enabled",
!document.querySelector("#additional_top_toolbar5").collapsed
);
});
});
observer5.observe(document.querySelector("#additional_top_toolbar5"), {
attributes: true,
childList: true,
characterData: true,
});
}
} catch (e) {}
},
};
/* initialization delay workaround */
document.addEventListener(
"DOMContentLoaded",
AdditionalTopToolbars.init(),
false
);
// not needed anymore, but just in case someone prefers initialization that way
/*
setTimeout(function(){
AdditionalTopToolbars.init();
},500);
*/

View file

@ -0,0 +1,42 @@
function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
resolve(document.querySelector(selector));
observer.disconnect();
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
});
}
waitForElm('#find-button').then((elm) => {
var find = document.querySelector("#find-button label.toolbarbutton-text");
find.setAttribute("value", "Search");
});
setTimeout(function () {
waitForElm('#nav-bar').then((elm) => {
var library = document.querySelector("#bookmarks-menu-button label.toolbarbutton-text");
library.setAttribute("value", "Favorites");
});
}, 0);
waitForElm('#bookmarksMenu').then((elm) => {
var bookmarksmenu = document.querySelector("#bookmarksMenu label.menubar-text");
bookmarksmenu.setAttribute("value", "Favorites");
bookmarksmenu.setAttribute("accesskey", "a");
});
waitForElm('#bookmarksMenu').then((elm) => {
var bookmarksmenu = document.querySelector("#bookmarksMenu");
bookmarksmenu.setAttribute("accesskey", "a");
});

View file

@ -0,0 +1,69 @@
Components.utils.import("resource:///modules/CustomizableUI.jsm");
var { Services } = Components.utils.import(
"resource://gre/modules/Services.jsm",
{}
);
var sss = Components.classes[
"@mozilla.org/content/style-sheet-service;1"
].getService(Components.interfaces.nsIStyleSheetService);
var IE6StatusBar = {
init: function () {
try {
// create a default toolbar button
CustomizableUI.createWidget({
id: "ie6_statusbar", // button id
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Internet", // button title
tooltiptext: "", // tooltip title
onCreated: function (button) {
return button;
},
});
// style button icon / embedded non-animated icon, because there is no image for then inside Fx anymore
var uri = Services.io.newURI(
"data:text/css;charset=utf-8," +
encodeURIComponent(
`#ie6_statusbar {
display: flex;
width: 151px;
height: 18px;
box-shadow: inset -1px -1px 0 ThreeDHighlight, inset 1px 1px 0 ThreeDShadow;
}
#ie6_statusbar::before {
content: "";
display: inline-block;
width: 16px;
height: 16px;
margin-right: 3px;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAeUExURYGBgf///8HBwQD/AACBAAAAhQAA/wAAAABmnAAAALYrxDEAAAAKdFJOU////////////wCyzCzPAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAYUlEQVQoU3XM0Q6AUAgCUEv05v//cGDWWls8yWHT6pMfMKWvBrNtdwAxYLu7eoZEADiSPVeDZXJNdoDSoETyzxvUB4CDnX8GoEl/bihtwXRvYAQRA3W1WOoNVUvpa+BJ1Qlz1waLzqVQ1QAAAABJRU5ErkJggg==");
}
#ie6_statusbar::after {
content: "Internet";
display: inline-block;
text-shadow: none !important;
}
#ie6_statusbar > .toolbarbutton-icon {
display: none;
}`
),
null,
null
);
// remove old style sheet, before registering the new one
if (sss.sheetRegistered(uri, sss.AGENT_SHEET)) {
sss.unregisterSheet(uri, sss.AGENT_SHEET);
}
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} catch (e) {
Components.utils.reportError(e);
}
},
};
document.addEventListener("DOMContentLoaded", IE6StatusBar.init(), false);

View file

@ -0,0 +1,69 @@
// 'Favicon in urlbars identity box' script for Firefox 92+ by Aris
//
// This script restores current pages favicon inside urlbar (aka location bar, address bar or awesome bar).
// [!] If a page does not offer a favicon, browser branches default icon is shown.
// [!] In a multi-window environment pages without favicons might show wrong icons.
// option: set icon for pages without favicon
var i_icon = 'chrome://global/skin/icons/info.svg';
var sheet = 'chrome://global/skin/icons/Portrait.png';
var brand = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABgUExURYaGhv///5mZmVVVVf/78ABmzDMzMwAAgDNm//Hx8czMzHd3d2aZmZnMzDMzzGb//+rq6pmZZv//mQDM/+fn1v/MmcyZZjNmzF9fXwAzmcDAwABmmYCAADMzZgQEBAAAANSdJEsAAAAgdFJOU/////////////////////////////////////////8AXFwb7QAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAIpJREFUKFNNjFsWgyAMREUIRGhTbOlLW7P/XRoD2t6Tj8w9k3TM3O3IzipMpbeHcEpvxOwCwDnrvVcRQHA4xD7ZTYTTmegCg8tRvnQcxqvU6QZDLnET6Y7bCUAuKtLjidKQg1Ibr/GNOE2Ec2t86EsoSG4/iJdlnjVXwZRMliDTBKd40IT9oeIP5hU1fA8vue4FsgAAAABJRU5ErkJggg==';
var globe = 'chrome://global/skin/icons/defaultFavicon.svg';
var icon_for_pages_without_favicon = brand; // i_icon, sheet, globe or brand (colorized Fx channel icon)
var favicon_click_opens_page_info_window = false;
var FaviconInUrlbar = {
init: function() {
try {
var favimginurlbar = document.createXULElement("image");
favimginurlbar.setAttribute("id","favimginurlbar");
if(favicon_click_opens_page_info_window)
favimginurlbar.setAttribute("onclick","gIdentityHandler.handleMoreInfoClick(event);");
favimginurlbar.style.width = "16px";
favimginurlbar.style.height = "16px";
favimginurlbar.style.marginLeft = "3px";
favimginurlbar.style.marginRight = "3px";
favimginurlbar.style.marginTop = "3px";
favimginurlbar.style.marginBottom = "3px";
//document.getElementById('identity-box').insertBefore(favimginurlbar,document.getElementById('identity-box').firstChild);
document.getElementById('identity-box').appendChild(favimginurlbar);
// update script every time tab attributes get modified (switch/open tabs/windows)
document.addEventListener("TabAttrModified", updateIcon, false);
document.addEventListener('TabSelect', updateIcon, false);
document.addEventListener('TabOpen', updateIcon, false);
document.addEventListener('TabClose', updateIcon, false);
document.addEventListener('load', updateIcon, false);
document.addEventListener("DOMContentLoaded", updateIcon, false);
function updateIcon() {
setTimeout(function(){ // timeout fixes wrong icon detection in some cases
// get current tabs favicon
var favicon_in_urlbar = gBrowser.selectedTab.image;
// if current tab offers no icon, use selected icon (icon_for_pages_without_favicon)
if(!gBrowser.selectedTab.image || gBrowser.selectedTab.image == null)
if(!icon_for_pages_without_favicon) favicon_in_urlbar = brand;
else favicon_in_urlbar = icon_for_pages_without_favicon;
document.querySelector('#favimginurlbar').style.listStyleImage = "url("+favicon_in_urlbar+")";
},1);
}
} catch(e) {}
}
};
// initiate script after DOM/browser content is loaded
document.addEventListener("DOMContentLoaded", FaviconInUrlbar.init(), false);

BIN
chrome/go.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

41
chrome/go_button.uc.js Normal file
View file

@ -0,0 +1,41 @@
(function () {
try {
Components.utils.import("resource:///modules/CustomizableUI.jsm");
var { Services } = Components.utils.import(
"resource://gre/modules/Services.jsm",
{}
);
var sss = Components.classes[
"@mozilla.org/content/style-sheet-service;1"
].getService(Components.interfaces.nsIStyleSheetService);
var appversion = parseInt(Services.appinfo.version);
var button_label = "Go";
CustomizableUI.createWidget({
id: "go-button", // button id
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: button_label, // button title
tooltiptext: button_label, // tooltip title
onClick: function (event) {
var cancelQuit = Components.classes[
"@mozilla.org/supports-PRBool;1"
].createInstance(Components.interfaces.nsISupportsPRBool);
var observerSvc = Components.classes[
"@mozilla.org/observer-service;1"
].getService(Components.interfaces.nsIObserverService);
if (event.button == "0") {
// left/middle-click - restart
gURLBar.handleCommand(event);
}
},
onCreated: function (button) {
return button;
},
});
} catch (e) {
Components.utils.reportError(e);
}
})();

83
chrome/move_bars.uc.js Normal file
View file

@ -0,0 +1,83 @@
// 'MoveUrlbar' script for Firefox 60+ by Aris
// option: place urlbar on a different toolbar
// option: place back button on a different toolbar
// option: place back button on a different toolbar
var { CustomizableUI } = Components.utils.import(
"resource:///modules/CustomizableUI.jsm",
{}
);
var navigation = CustomizableUI.AREA_NAVBAR;
var tabs = CustomizableUI.AREA_TABSTRIP;
var menu = CustomizableUI.AREA_MENUBAR;
var bookmarks = CustomizableUI.AREA_BOOKMARKS;
/* [target toolbar of item]
menu = 'menubar'
tabs = 'tabs toolbar'
bookmarks = 'bookmarks toolbar'
navigation='navigation toolbar' */
var backbutton_on_toolbar = navigation;
var forwardbutton_on_toolbar = navigation;
var urlbar_on_toolbar = navigation;
/* [target position of item]
0 = 1st
1 = 2nd
2 = 3rd
...
x = xth */
var backbutton_on_toolbar_position = 0;
var forwardbutton_on_toolbar_position = 1;
var urlbar_on_toolbar_position = 0;
var MoveUrlbar = {
init: function () {
try {
document.getElementById("back-button").setAttribute("removable", "true");
document
.getElementById("forward-button")
.setAttribute("removable", "true");
document
.getElementById("urlbar-container")
.setAttribute("removable", "true");
document
.getElementById("additional_top_toolbar1")
.setAttribute("fullscreentoolbar", "true");
} catch (e) {}
/*CustomizableUI.addWidgetToArea("back-button", backbutton_on_toolbar);
CustomizableUI.moveWidgetWithinArea(
"back-button",
backbutton_on_toolbar_position
);
CustomizableUI.addWidgetToArea("forward-button", forwardbutton_on_toolbar);
CustomizableUI.moveWidgetWithinArea(
"forward-button",
forwardbutton_on_toolbar_position
);
CustomizableUI.addWidgetToArea(
"urlbar-container",
"additional_top_toolbar1"
);
CustomizableUI.moveWidgetWithinArea(
"urlbar-container",
urlbar_on_toolbar_position
);*/
document
.getElementById("navigator-toolbox")
.appendChild(document.getElementById("TabsToolbar"));
/*
try {
document.getElementById('back-button').setAttribute('removable','false');
document.getElementById('forward-button').setAttribute('removable','false');
document.getElementById('urlbar-container').setAttribute('removable','false');
} catch(e){}
*/
},
};
document.addEventListener("DOMContentLoaded", MoveUrlbar.init(), false);

143
chrome/scrollbar.uc.js Normal file
View file

@ -0,0 +1,143 @@
(function () {
var css = `@media all and (-moz-overlay-scrollbars) {
scrollbar[root="true"] {
position: relative;
z-index: 9999999;
}
scrollbar:not([active="true"]),
scrollbar[disabled="true"] {
visibility: hidden;
}
}
scrollbar
{
color-scheme: light !important;
-moz-appearance: none;
-moz-binding: url("chrome://global/content/bindings/scrollbar.xml#scrollbar");
cursor: default;
min-width: 16px !important;
background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdib3g9IjAgMCAyIDIiIHdpZHRoPSIyIiBoZWlnaHQ9IjIiPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9Ii1tb3otZGlhbG9nIi8+PHJlY3QgZmlsbD0iVGhyZWVESGlnaGxpZ2h0IiB4PSIxIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iMSIgeT0iMSIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0iLW1vei1kaWFsb2ciLz48cmVjdCBmaWxsPSJUaHJlZURIaWdobGlnaHQiIHg9IjAiIHk9IjEiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48L3N2Zz4=") repeat !important;
}
thumb
{
color-scheme: light !important;
-moz-appearance: none !important;
position: relative !important;
background-color: -moz-Dialog !important;
min-height: 8px !important;
pointer-events: auto !important;
border: 0 !important;
box-shadow: inset -1px -1px 0 rgb(0, 0, 0), inset 1px 1px 0 -moz-Dialog, inset -2px -2px 0 ThreeDShadow, inset 2px 2px 0 ThreeDHighlight !important;
}
thumb[orient="horizontal"] {
-moz-appearance: none;
min-height: 16px !important;
min-width: 8px !important;
max-width: 100% !important;
background-repeat: no-repeat !important;
}
scrollbarbutton
{
color-scheme: light !important;
min-width: 16px !important;
min-height: 16px !important;
-moz-default-appearance: none !important;
background-color: -moz-Dialog !important;
box-shadow: inset -1px -1px 0 rgb(0, 0, 0), inset 1px 1px 0 -moz-Dialog, inset -2px -2px 0 ThreeDShadow, inset 2px 2px 0 ThreeDHighlight !important;
}
scrollbarbutton:not(.disabled):hover:active
{
background-color: -moz-dialog !important;
border: 1px solid ThreeDShadow !important;
box-shadow: none !important;
}
slider,
slider[orient="vertical"]
{
color-scheme: light !important;
-moz-appearance: none;
}
scrollcorner
{
color-scheme: light !important;
-moz-appearance: none !important;
-moz-binding: url(chrome://global/content/bindings/scrollbar.xml#scrollbar-base);
width: 16px;
cursor: default;
background-color: -moz-dialog; !important;
}
scrollbarbutton[type="increment"]
{
-moz-appearance: none;
background-repeat: no-repeat !important;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIxNSIgdmlld0JveD0iMCAwIDE1IDE1Ij4NCgk8cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSI3IiB5PSI0IiB4PSI1IiBmaWxsPSJtZW51dGV4dCIvPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjUiIHk9IjUiIHg9IjYiIGZpbGw9Im1lbnV0ZXh0Ii8+PHJlY3Qgd2lkdGg9IjEiIGhlaWdodD0iMyIgeT0iNiIgeD0iNyIgZmlsbD0ibWVudXRleHQiLz48cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB5PSI3IiB4PSI4IiBmaWxsPSJtZW51dGV4dCIvPg0KCQ0KCQ0KPC9zdmc+") !important;
background-position: center center !important;
}
scrollbar[orient="vertical"] > scrollbarbutton[type="increment"]
{
-moz-appearance: none;
background-repeat: no-repeat !important;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTUiIHdpZHRoPSIxNSIgdmlld0JveD0iMCAwIDE1IDE1Ij4NCgk8cmVjdCBoZWlnaHQ9IjEiIHdpZHRoPSI3IiB4PSIzIiB5PSI1IiBmaWxsPSJtZW51dGV4dCIvPjxyZWN0IGhlaWdodD0iMSIgd2lkdGg9IjUiIHk9IjYiIHg9IjQiIGZpbGw9Im1lbnV0ZXh0Ii8+PHJlY3QgaGVpZ2h0PSIxIiB3aWR0aD0iMyIgeD0iNSIgeT0iNyIgZmlsbD0ibWVudXRleHQiLz48cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4PSI2IiB5PSI4IiBmaWxsPSJtZW51dGV4dCIvPg0KCQ0KCQ0KPC9zdmc+") !important;
background-position: center center !important;
}
scrollbarbutton[type="decrement"]
{
-moz-appearance: none;
background-repeat: no-repeat !important;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTUiIHdpZHRoPSIxNSIgdmlld0JveD0iMCAwIDE1IDE1Ij4NCgk8cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSI3IiB5PSI0IiB4PSI4IiBmaWxsPSJtZW51dGV4dCIvPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjUiIHk9IjUiIHg9IjciIGZpbGw9Im1lbnV0ZXh0Ii8+PHJlY3Qgd2lkdGg9IjEiIGhlaWdodD0iMyIgeT0iNiIgeD0iNiIgZmlsbD0ibWVudXRleHQiLz48cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB5PSI3IiB4PSI1IiBmaWxsPSJtZW51dGV4dCIvPg0KCQ0KCQ0KPC9zdmc+") !important;
background-position: center center !important;
}
scrollbar[orient="vertical"] > scrollbarbutton[type="decrement"]
{
-moz-appearance: none;
background-repeat: no-repeat !important;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIxNSIgdmlld0JveD0iMCAwIDE1IDE1Ij4NCgk8cmVjdCBoZWlnaHQ9IjEiIHdpZHRoPSI3IiB5PSI4IiB4PSIzIiBmaWxsPSJtZW51dGV4dCIvPjxyZWN0IGhlaWdodD0iMSIgd2lkdGg9IjUiIHg9IjQiIHk9IjciIGZpbGw9Im1lbnV0ZXh0Ii8+PHJlY3QgaGVpZ2h0PSIxIiB3aWR0aD0iMyIgeT0iNiIgeD0iNSIgZmlsbD0ibWVudXRleHQiLz48cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB5PSI1IiB4PSI2IiBmaWxsPSJtZW51dGV4dCIvPg0KCQ0KCQ0KPC9zdmc+") !important;
background-position: center center !important;
}
scrollbarbutton[type="increment"][disabled="true"]
{
background-repeat: no-repeat !important;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIxNSIgdmlld0JveD0iMCAwIDE1IDE1Ij4NCgk8cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIHdpZHRoPSIxIiBoZWlnaHQ9IjciIHk9IjQiIHg9IjUiLz48cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSIyIiBmaWxsPSJUaHJlZURIaWdobGlnaHQiIHg9IjYiIHk9IjEwIi8+PHJlY3Qgd2lkdGg9IjEiIGhlaWdodD0iMiIgZmlsbD0iVGhyZWVESGlnaGxpZ2h0IiB4PSI3IiB5PSI5Ii8+PHJlY3Qgd2lkdGg9IjEiIGhlaWdodD0iMiIgZmlsbD0iVGhyZWVESGlnaGxpZ2h0IiB4PSI4IiB5PSI4Ii8+PHJlY3Qgd2lkdGg9IjEiIGZpbGw9IlRocmVlREhpZ2hsaWdodCIgaGVpZ2h0PSIxIiB5PSI4IiB4PSI5Ii8+PHJlY3QgZmlsbD0iVGhyZWVEU2hhZG93IiB3aWR0aD0iMSIgaGVpZ2h0PSI1IiB5PSI1IiB4PSI2Ii8+PHJlY3QgZmlsbD0iVGhyZWVEU2hhZG93IiB3aWR0aD0iMSIgaGVpZ2h0PSIzIiB5PSI2IiB4PSI3Ii8+PHJlY3QgZmlsbD0iVGhyZWVEU2hhZG93IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB5PSI3IiB4PSI4Ii8+DQoJDQoJDQo8L3N2Zz4=");
background-position: center center !important;
}
scrollbar[orient="vertical"] > scrollbarbutton[type="increment"][disabled="true"]
{
background-repeat: no-repeat !important;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTUiIHdpZHRoPSIxNSIgdmlld0JveD0iMCAwIDE1IDE1Ij4NCgk8cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIGhlaWdodD0iMSIgd2lkdGg9IjciIHg9IjMiIHk9IjUiLz48cmVjdCBmaWxsPSJUaHJlZURIaWdobGlnaHQiIGhlaWdodD0iMSIgd2lkdGg9IjIiIHk9IjYiIHg9IjkiLz48cmVjdCBmaWxsPSJUaHJlZURIaWdobGlnaHQiIGhlaWdodD0iMSIgd2lkdGg9IjIiIHk9IjciIHg9IjgiLz48cmVjdCBmaWxsPSJUaHJlZURIaWdobGlnaHQiIGhlaWdodD0iMSIgd2lkdGg9IjIiIHg9IjciIHk9IjgiLz48cmVjdCBmaWxsPSJUaHJlZURIaWdobGlnaHQiIGhlaWdodD0iMSIgd2lkdGg9IjEiIHg9IjciIHk9IjkiLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIGhlaWdodD0iMSIgd2lkdGg9IjUiIHk9IjYiIHg9IjQiLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIGhlaWdodD0iMSIgd2lkdGg9IjMiIHg9IjUiIHk9IjciLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHg9IjYiIHk9IjgiLz4NCgkNCgkNCjwvc3ZnPg==");
background-position: center center !important;
}
scrollbarbutton[type="decrement"][disabled="true"]
{
background-repeat: no-repeat !important;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTUiIHdpZHRoPSIxNSIgdmlld0JveD0iMCAwIDE1IDE1Ij4NCgk8cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIHdpZHRoPSIxIiBoZWlnaHQ9IjciIHk9IjQiIHg9IjgiLz48cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSI3IiBmaWxsPSJUaHJlZURIaWdobGlnaHQiIHk9IjUiIHg9IjkiLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIHdpZHRoPSIxIiBoZWlnaHQ9IjUiIHk9IjUiIHg9IjciLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIHdpZHRoPSIxIiBoZWlnaHQ9IjMiIHk9IjYiIHg9IjYiLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHk9IjciIHg9IjUiLz4NCgkNCgkNCjwvc3ZnPg==");
background-position: center center !important;
}
scrollbar[orient="vertical"] > scrollbarbutton[type="decrement"][disabled="true"]
{
background-repeat: no-repeat !important;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIxNSIgdmlld0JveD0iMCAwIDE1IDE1Ij4NCgk8cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIGhlaWdodD0iMSIgd2lkdGg9IjciIHk9IjgiIHg9IjMiLz48cmVjdCBmaWxsPSJUaHJlZURIaWdobGlnaHQiIHdpZHRoPSI3IiBoZWlnaHQ9IjEiIHk9IjkiIHg9IjQiLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIGhlaWdodD0iMSIgd2lkdGg9IjUiIHg9IjQiIHk9IjciLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIGhlaWdodD0iMSIgd2lkdGg9IjMiIHk9IjYiIHg9IjUiLz48cmVjdCBmaWxsPSJUaHJlZURTaGFkb3ciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHk9IjUiIHg9IjYiLz4NCgkNCgkNCjwvc3ZnPg==") !important;
background-position: center !important;
}`;
var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(
Ci.nsIStyleSheetService
);
var uri = makeURI("data:text/css;charset=UTF=8," + encodeURIComponent(css));
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
})();

View file

@ -0,0 +1,181 @@
// Restore 'Space & Separator' items script for Firefox 60+ by Aris
//
// Default browser scripts always remove spaces and separators from default palette, so
// because of that they are added to an own toolbar now.
//
// - spaces and separators can be moved to any toolbar
// - to remove spaces or separators move them into palette
// - configuration toolbar behaves like a default toolbar, items and buttons can be placed on it
// - configuration toolbar is not visible outside customizing mode
// - default "Flexible Space" item is hidden from palette and added to configuration toolbar
// [!] BUG: do not move spaces, flexible spaces or separator to configuration toolbar or it will cause glitches
// [!] BUG: do not move main 'space'-item to palette or it will be hidden until customizing mode gets reopened
// [!] Fix for WebExtensions with own windows by 黒仪大螃蟹 (for 1-N scripts)
Components.utils.import("resource:///modules/CustomizableUI.jsm");
var {Services} = Components.utils.import("resource://gre/modules/Services.jsm", {});
var appversion = parseInt(Services.appinfo.version);
var AddSeparator = {
init: function() {
if (appversion >= 76 && location != 'chrome://browser/content/browser.xhtml')
return;
/* blank tab workaround */
try {
if(gBrowser.selectedBrowser.getAttribute('blank')) gBrowser.selectedBrowser.removeAttribute('blank');
} catch(e) {}
var tb_config_label = "Configuration Toolbar";
var tb_spacer_label = "Space";
var tb_sep_label = "Separator";
var tb_spring_label = "Flexible Space";
try {
if(document.getElementById('configuration_toolbar') == null) {
if(appversion <= 62) var tb_config = document.createElement("toolbar");
else var tb_config = document.createXULElement("toolbar");
tb_config.setAttribute("id","configuration_toolbar");
tb_config.setAttribute("customizable","true");
tb_config.setAttribute("class","toolbar-primary chromeclass-toolbar browser-toolbar customization-target");
tb_config.setAttribute("mode","icons");
tb_config.setAttribute("iconsize","small");
tb_config.setAttribute("toolboxid","navigator-toolbox");
tb_config.setAttribute("lockiconsize","true");
tb_config.setAttribute("ordinal","1005");
tb_config.setAttribute("defaultset","toolbarspacer,toolbarseparator");
document.querySelector('#navigator-toolbox').appendChild(tb_config);
CustomizableUI.registerArea("configuration_toolbar", {legacy: true});
if(appversion >= 65) CustomizableUI.registerToolbarNode(tb_config);
if(appversion <= 62) var tb_label = document.createElement("label");
else var tb_label = document.createXULElement("label");
tb_label.setAttribute("label", tb_config_label+": ");
tb_label.setAttribute("value", tb_config_label+": ");
tb_label.setAttribute("id","tb_config_tb_label");
tb_label.setAttribute("removable","false");
tb_config.appendChild(tb_label);
if(appversion <= 62) var tb_spacer = document.createElement("toolbarspacer");
else var tb_spacer = document.createXULElement("toolbarspacer");
tb_spacer.setAttribute("id","spacer");
tb_spacer.setAttribute("class","chromeclass-toolbar-additional");
tb_spacer.setAttribute("customizableui-areatype","toolbar");
tb_spacer.setAttribute("removable","false");
tb_spacer.setAttribute("label", tb_spacer_label);
tb_config.appendChild(tb_spacer);
if(appversion <= 62) var tb_sep = document.createElement("toolbarseparator");
else var tb_sep = document.createXULElement("toolbarseparator");
tb_sep.setAttribute("id","separator");
tb_sep.setAttribute("class","chromeclass-toolbar-additional");
tb_sep.setAttribute("customizableui-areatype","toolbar");
tb_sep.setAttribute("removable","false");
tb_sep.setAttribute("label", tb_sep_label);
tb_config.appendChild(tb_sep);
if(appversion <= 62) var tb_spring = document.createElement("toolbarspring");
else var tb_spring = document.createXULElement("toolbarspring");
tb_spring.setAttribute("id","spring");
tb_spring.setAttribute("class","chromeclass-toolbar-additional");
tb_spring.setAttribute("customizableui-areatype","toolbar");
tb_spring.setAttribute("removable","false");
tb_spring.setAttribute("flex","1");
tb_spring.setAttribute("label", tb_spring_label);
tb_config.appendChild(tb_spring);
// CSS
var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService);
var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent('\
\
#configuration_toolbar { \
-moz-appearance: none !important; \
background-color: var(--toolbar-bgcolor); \
background-image: var(--toolbar-bgimage); \
background-clip: padding-box; \
color: var(--toolbar-color, inherit); \
} \
#main-window:not([customizing]) #configuration_toolbar { \
visibility: collapse; \
}\
#main-window[customizing] #configuration_toolbar #tb_config_tb_label { \
font-weight: bold !important; \
}\
#main-window[customizing] #configuration_toolbar :-moz-any(#spacer,#separator,#spring) { \
-moz-margin-start: 20px; \
}\
#main-window[customizing] #configuration_toolbar :-moz-any(#wrapper-spacer,#wrapper-separator,#wrapper-spring) .toolbarpaletteitem-label { \
display: block !important; \
-moz-margin-end: 20px; \
}\
#main-window[customizing] #wrapper-spacer #spacer { \
margin: 2px 0 !important; \
}\
#main-window[customizing] #configuration_toolbar #wrapper-spring #spring { \
margin: -1px 0 !important; \
min-width: 80px !important; \
}\
#main-window[customizing] #configuration_toolbar > * { \
padding: 10px !important; \
}\
#main-window[customizing] #configuration_toolbar > :-moz-any(#wrapper-spacer,#wrapper-separator,#wrapper-spring) { \
border: 1px dotted !important; \
-moz-margin-start: 2px !important; \
-moz-margin-end: 2px !important; \
}\
#main-window[customizing] toolbarspacer { \
border: 1px solid !important; \
}\
toolbar[orient="vertical"] toolbarseparator { \
-moz-appearance: none !important; \
border-top: 1px solid rgba(15,17,38, 0.5) !important; \
border-bottom: 1px solid rgba(255,255,255, 0.3) !important; \
margin: 2px 2px !important; \
height: 1px !important; \
width: 18px !important; \
}\
toolbar[orient="vertical"] toolbarspacer { \
-moz-appearance: none !important; \
height: 18px !important; \
width: 18px !important; \
}\
#customization-palette toolbarpaletteitem[id^="wrapper-customizableui-special-spring"], \
#customization-palette-container :-moz-any(#spring,#wrapper-spring) { \
display: none !important; \
}\
#main-window:not([customizing]) toolbar:not(#configuration_toolbar) toolbarspring {\
max-width: 100% !important; \
}\
\
'), null, null);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
}
} catch(e){}
}
}
/* initialization delay workaround */
document.addEventListener("DOMContentLoaded", AddSeparator.init(), false);
/* Use the below code instead of the one above this line, if issues occur */
/*
setTimeout(function(){
AddSeparator.init();
},2000);
*/

View file

@ -0,0 +1,23 @@
:root[uidensity="touch"] #nav-bar toolbarbutton:not(#nav-bar-overflow-button):not(#PanelUI-menu-button) .toolbarbutton-text {
display: unset !important;
}
:root[uidensity="touch"] #nav-bar {
height: 42px !important;
}
:root[uidensity="touch"] #nav-bar toolbarbutton:not(#nav-bar-overflow-button):not(#PanelUI-menu-button) {
min-width: 58px !important;
padding-top: 2px !important;
}
:root[uidensity="touch"] #nav-bar toolbarbutton {
-moz-box-orient: vertical;
}
:root[uidensity="touch"] #nav-bar .toolbarbutton-1 .toolbarbutton-text {
margin-top: 3px !important;
padding-left: 0 !important;
padding-right: 0 !important;
}

BIN
chrome/toolbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
chrome/toolbar_large.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

2251
chrome/userChrome.css Normal file

File diff suppressed because one or more lines are too long