-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(new script) fix titlebar button tooltips;
(CSS) fix the app menu exit fullscreen button's icon; (CSS) style the parsererror page so the yellow isn't so blinding.
- Loading branch information
1 parent
5394e70
commit add1784
Showing
7 changed files
with
81 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// ==UserScript== | ||
// @name Fix Titlebar Button Tooltips | ||
// @version 1.0 | ||
// @author aminomancer | ||
// @homepage https://github.com/aminomancer/uc.css.js | ||
// @description Since bug 1718629 (https://bugzilla.mozilla.org/show_bug.cgi?id=1718629), Firefox has tried to make the titlebar buttons (window controls) function more like native controls. In doing so, it allows the OS to draw tooltips for these buttons. So it prevents itself from showing redundant tooltips. That means we can't style the titlebar buttons' tooltips, they don't obey preferences, they disappear after 5 seconds on Windows, and they don't appear at all in fullscreen mode. Personally I would not be a fan of this change even if I didn't heavily customize Firefox's tooltips, because no matter what, OS tooltips are not going to be consistent with Firefox's tooltips, for reasons I mentioned. But in any case, we can fix this issue with JavaScript. It's caused by the titlebar-btn attribute. But removing that programmatically won't work because it's parsed by a C++ component when the buttons are connected. It's already too late by the time the script is running. So we need to recreate the DOM nodes without this attribute. | ||
// @include * | ||
// ==/UserScript== | ||
|
||
class FixTitlebarTooltips { | ||
constructor() { | ||
this.markup = `<hbox class="titlebar-buttonbox-container" skipintoolbarset="true"> | ||
<hbox class="titlebar-buttonbox titlebar-color"> | ||
<toolbarbutton class="titlebar-button titlebar-min" | ||
oncommand="window.minimize();" | ||
data-l10n-id="browser-window-minimize-button" | ||
/> | ||
<toolbarbutton class="titlebar-button titlebar-max" | ||
oncommand="window.maximize();" | ||
data-l10n-id="browser-window-maximize-button" | ||
/> | ||
<toolbarbutton class="titlebar-button titlebar-restore" | ||
oncommand="window.fullScreen ? BrowserFullScreen() : window.restore();" | ||
data-l10n-id="browser-window-restore-down-button" | ||
/> | ||
<toolbarbutton class="titlebar-button titlebar-close" | ||
command="cmd_closeWindow" | ||
data-l10n-id="browser-window-close-button" | ||
/> | ||
</hbox> | ||
</hbox>`; | ||
let boxes = document.querySelectorAll(".titlebar-buttonbox-container"); | ||
boxes.forEach((box) => box.replaceWith(MozXULElement.parseXULToFragment(this.markup))); | ||
} | ||
} | ||
new FixTitlebarTooltips(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters