Skip to content

Commit 7b353e5

Browse files
committed
(JS) update some scripts to account for
new namespace rules for XUL display values. (CSS) update some stylesheets for the same reason. fix a searchbar style. fix an oversight in navbarToolbarButtonSlider.uc.js. remove an obsolete option from miscMods.uc.js.
1 parent 6139802 commit 7b353e5

14 files changed

Lines changed: 83 additions & 99 deletions

JS/extensionOptionsPanel.uc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Extension Options Panel
3-
// @version 1.8.4
3+
// @version 1.8.5
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer/uc.css.js
66
// @description This script creates a toolbar button that opens a popup panel
@@ -1044,7 +1044,7 @@ class ExtensionOptionsWidget {
10441044
content: url(chrome://global/skin/icons/check.svg);
10451045
fill: currentColor;
10461046
fill-opacity: 0.6;
1047-
display: -moz-box;
1047+
display: block;
10481048
margin-inline-start: 10px;
10491049
}
10501050
#eom-theme-preview-tooltip {

JS/miscMods.uc.js

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Misc. Mods
3-
// @version 2.0.1
3+
// @version 2.0.2
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer/uc.css.js
66
// @description Various tiny mods not worth making separate scripts for. Read the comments inside the script for details.
@@ -141,8 +141,6 @@
141141
this.makeDefaultBookmarkFolderPermanent();
142142
if (config["Turn private browsing indicator into button"])
143143
this.privateBrowsingIndicatorButton();
144-
if (config["Anchor permissions popup to granted permission icon"])
145-
this.anchorPermissionsPopup();
146144
if (config["Don't exit DOM fullscreen when opening permissions popup"])
147145
this.permsPopupInFullscreen();
148146
if (config["Customize tab drag preview background color"]) this.tabDragPreview();
@@ -303,30 +301,6 @@
303301
oncommand="openHelpLink('private-browsing-myths')" />`;
304302
indicator.replaceWith(MozXULElement.parseXULToFragment(markup));
305303
}
306-
anchorPermissionsPopup() {
307-
gPermissionPanel._initializePopup();
308-
eval(
309-
`gPermissionPanel.openPopup = function ` +
310-
gPermissionPanel.openPopup
311-
.toSource()
312-
.replace(/_openPopup/, "")
313-
.replace(/\"bottomcenter/, `"bottomleft`)
314-
.replace(
315-
/(PanelMultiView\.openPopup)/,
316-
`let bounds = windowUtils.getBoundsWithoutFlushing;\n let anchorBounds = bounds(this._permissionGrantedIcon);\n let diff = anchorBounds.left - bounds(this._identityPermissionBox).left + (anchorBounds.width / 2);\n this._permissionPopup.style.setProperty("--uc-panel-left-offset", diff + "px");\n\n $1`
317-
)
318-
);
319-
let { _permissionPopup } = gPermissionPanel;
320-
_permissionPopup.setAttribute("anchor-to-icon", true);
321-
// we want the icon to be the same height as the container. normally it's only 16px
322-
// which affects the popup positioning. we can increase the height but it's just an
323-
// image element. so, doing so would mean the icon must have explicit width/height
324-
// attributes. otherwise the image will be resized vertically by a lot. the icon does
325-
// have explicit values, but some users may use custom icons. so to ensure this doesn't
326-
// happen, set block padding equal to half the difference between the icon height and
327-
// the urlbar height, minus the urlbar padding.
328-
_permissionPopup.style.marginInline = `calc(-20px + var(--uc-panel-left-offset, 0px))`;
329-
}
330304
permsPopupInFullscreen() {
331305
gPermissionPanel._initializePopup();
332306
eval(

JS/navbarToolbarButtonSlider.uc.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Navbar Toolbar Button Slider
3-
// @version 2.8.1
3+
// @version 2.8.2
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer
66
// @description Wrap all toolbar buttons in a scrollable container. It can
@@ -122,8 +122,17 @@ class NavbarToolbarSlider {
122122
);
123123
}
124124
constructor() {
125-
this.outer = document.createElement("toolbaritem");
126-
this.inner = this.outer.appendChild(document.createElement("hbox"));
125+
this.outer = document.createXULElement("toolbaritem");
126+
Object.defineProperty(this.outer, "hidden", {
127+
get() {
128+
return this.getAttribute("hidden") === "true";
129+
},
130+
set(val) {
131+
if (val) this.setAttribute("hidden", "true");
132+
else this.removeAttribute("hidden");
133+
},
134+
});
135+
this.inner = this.outer.appendChild(document.createXULElement("hbox"));
127136
this.kids = this.inner.children;
128137
this.navbar = document.getElementById("nav-bar");
129138
this.cTarget = document.getElementById(this.navbar.getAttribute("customizationtarget"));
@@ -316,7 +325,7 @@ class NavbarToolbarSlider {
316325
await this.navbar.overflowable._moveItemsBackToTheirOrigin(true);
317326
this.unwrapAll();
318327
this.wrapAll([...this.widgets].filter(this.filterFn, this), this.inner);
319-
this.outer.style.display = "-moz-box";
328+
this.outer.hidden = false;
320329
}
321330
onCustomizeStart() {
322331
let overflown = this.isOverflowing;
@@ -327,7 +336,7 @@ class NavbarToolbarSlider {
327336
// or else we get a tiny bug where dragging a widget ahead of the empty
328337
// slider causes the widget to teleport to the end.
329338
this.bin.appendChild(this.outer);
330-
this.outer.style.display = overflown ? "none" : "-moz-box";
339+
this.outer.hidden = overflown;
331340
}
332341
onCustomizeEnd() {
333342
let overflown = this.isOverflowing;
@@ -336,14 +345,14 @@ class NavbarToolbarSlider {
336345
this.wrapAll(array, this.cOverflow);
337346
this.cOverflow.insertBefore(this.outer, this.cOverflow.firstElementChild);
338347
} else this.wrapAll(array, this.inner);
339-
this.outer.style.display = overflown ? "none" : "-moz-box";
348+
this.outer.hidden = overflown;
340349
this.setMaxWidth();
341350
}
342351
onWidgetOverflow(aNode, aContainer) {
343352
if (aNode.ownerGlobal !== window) return;
344353
if (aNode === this.outer && aContainer === this.cTarget) {
345354
NavbarToolbarSlider.appendLoop(this.kids, this.cOverflow);
346-
this.outer.style.display = "none";
355+
this.outer.hidden = true;
347356
this.reOrder();
348357
}
349358
}
@@ -352,7 +361,7 @@ class NavbarToolbarSlider {
352361
if (aNode === this.outer && aContainer === this.cTarget) {
353362
this.unwrapAll();
354363
this.wrapAll([...this.widgets].filter(this.filterFn, this), this.inner);
355-
this.outer.style.display = "-moz-box";
364+
this.outer.hidden = false;
356365
this.reOrder();
357366
}
358367
}
@@ -615,15 +624,15 @@ class NavbarToolbarSlider {
615624
clicktoscroll: true,
616625
orient: "horizontal",
617626
style:
618-
"display: -moz-box; -moz-box-align: center; -moz-box-orient: vertical; scrollbar-width: none; box-sizing: border-box; scroll-behavior: smooth; overflow: hidden; transition: max-width 0.2s ease-out;",
627+
"-moz-box-align: center; -moz-box-orient: vertical; scrollbar-width: none; box-sizing: border-box; scroll-behavior: smooth; overflow: hidden; transition: max-width 0.2s ease-out;",
619628
})) {
620629
outer.setAttribute(key, val);
621630
}
622631
if (!this.collapse) outer.setAttribute("overflows", false);
623632
for (const [key, val] of Object.entries({
624633
class: "slider-inner-container",
625634
id: "nav-bar-toolbarbutton-slider",
626-
style: "display: -moz-box; -moz-box-flex: 1;",
635+
style: "-moz-box-flex: 1;",
627636
})) {
628637
inner.setAttribute(key, val);
629638
}

JS/restoreTabSoundButton.uc.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Restore pre-Proton Tab Sound Button
3-
// @version 2.3.3
3+
// @version 2.3.4
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer/uc.css.js
66
// @description Proton makes really big changes to tabs, in particular
@@ -29,9 +29,6 @@
2929
.tab-secondary-label {
3030
display: none;
3131
}
32-
.tab-icon-sound {
33-
display: -moz-box;
34-
}
3532
.tab-icon-sound:not([soundplaying], [muted], [activemedia-blocked], [pictureinpicture]),
3633
.tab-icon-sound[pinned] {
3734
display: none;

JS/verticalTabsPane.uc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Vertical Tabs Pane
3-
// @version 1.6.5
3+
// @version 1.6.6
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer/uc.css.js
66
// @description Create a vertical pane across from the sidebar that functions
@@ -2197,7 +2197,7 @@
21972197
}
21982198
@supports -moz-bool-pref("userChrome.tabs.tooltip.always-show-lock-icon") {
21992199
#vertical-tabs-tooltip #places-tooltip-insecure-icon {
2200-
display: -moz-inline-box !important;
2200+
display: inline-block !important;
22012201
}
22022202
}
22032203
#vertical-tabs-tooltip #places-tooltip-insecure-icon[pending] {

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ I also recommend setting the following prefs in `about:config`. There are two pr
107107
| <i>layout.css.backdrop-filter.enabled</i> | Boolean | true | Required for the acrylic/glass gaussian blur effect |
108108
| <i>layout.css.cached-scrollbar-styles.enabled</i> | Boolean | false | Recommended for the scrollbar styles in userChrome.ag.css |
109109
| <i>layout.css.moz-document.content.enabled</i> | Boolean | true | Required |
110-
| <i>layout.css.xul-box-display-values.content.enabled</i> | Boolean | true | Required |
111-
| <i>layout.css.xul-display-values.content.enabled</i> | Boolean | true | Required |
112-
| layout.css.xul-tree-pseudos.content.enabled | Boolean | true | |
113110
| mousewheel.autodir.enabled | Boolean | false | Allow mousewheel ⇅ to scroll ⇄-only scrollboxes |
114111
| prompts.contentPromptSubDialog | Boolean | true | Use the modern content dialog instead of modal prompts |
115112
| reader.color\_scheme | String | `dark` | |

prefs/recommended.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false);
1212
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
1313
user_pref("browser.proton.places-tooltip.enabled", true);
1414
user_pref("layout.css.moz-document.content.enabled", true);
15-
user_pref("layout.css.xul-box-display-values.content.enabled", true);
16-
user_pref("layout.css.xul-display-values.content.enabled", true);
1715
//// eliminate the blank white window during startup
1816
user_pref("browser.startup.blankWindow", false);
1917
user_pref("browser.startup.preXulSkeletonUI", false);
@@ -28,8 +26,6 @@ user_pref("layout.css.cached-scrollbar-styles.enabled", false);
2826
user_pref("ui.systemUsesDarkTheme", 1);
2927
// enable content dark mode
3028
user_pref("layout.css.prefers-color-scheme.content-override", 0);
31-
// allow stylesheets to modify trees in system pages viewed in regular tabs
32-
user_pref("layout.css.xul-tree-pseudos.content.enabled", true);
3329
// allow the color-mix() CSS function
3430
user_pref("layout.css.color-mix.enabled", true);
3531
// other CSS features

prefs/required.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false);
1212
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
1313
user_pref("browser.proton.places-tooltip.enabled", true);
1414
user_pref("layout.css.moz-document.content.enabled", true);
15-
user_pref("layout.css.xul-box-display-values.content.enabled", true);
16-
user_pref("layout.css.xul-display-values.content.enabled", true);
1715
//// eliminate the blank white window during startup
1816
user_pref("browser.startup.blankWindow", false);
1917
user_pref("browser.startup.preXulSkeletonUI", false);
@@ -28,8 +26,6 @@ user_pref("layout.css.cached-scrollbar-styles.enabled", false);
2826
user_pref("ui.systemUsesDarkTheme", 1);
2927
// enable content dark mode
3028
user_pref("layout.css.prefers-color-scheme.content-override", 0);
31-
// allow stylesheets to modify trees in system pages viewed in regular tabs
32-
user_pref("layout.css.xul-tree-pseudos.content.enabled", true);
3329
// allow the color-mix() CSS function
3430
user_pref("layout.css.color-mix.enabled", true);
3531
// other CSS features

resources/in-content/devtools.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -403,18 +403,6 @@ and a few elements like checkboxes */
403403
padding: 0 !important;
404404
}
405405

406-
menuseparator[id]:not(#context-sep-open, #context-media-sep-commands, #context-sep-copylink, #spell-suggestions-separator, #context-sep-selectall) {
407-
display: none !important;
408-
}
409-
410-
menuseparator:not([id]) {
411-
display: -moz-box !important;
412-
}
413-
414-
menuseparator:last-child {
415-
display: none;
416-
}
417-
418406
menupopup[menu-api] menuitem:is([type="checkbox"], [type="radio"]) .menu-iconic-left {
419407
display: none !important;
420408
}

resources/in-content/ext-zoomscheduler.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@
114114
border-color: var(--global-focus-outline-color) !important;
115115
}
116116

117+
:root[uc-extension-id="{bf855ead-d7c3-4c7b-9f88-9a7e75c0efdf}"i] button > .drop-icon {
118+
color: var(--ui-text-50) !important;
119+
}
120+
121+
:root[uc-extension-id="{bf855ead-d7c3-4c7b-9f88-9a7e75c0efdf}"i]
122+
.btn-group.open button
123+
> .drop-icon {
124+
color: inherit !important;
125+
}
126+
117127
:root[uc-extension-id="{bf855ead-d7c3-4c7b-9f88-9a7e75c0efdf}"i] .btn:focus {
118128
outline: 1px auto !important;
119129
}

0 commit comments

Comments
 (0)