Skip to content

Commit

Permalink
update scripts and CSS for recent nightly changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
aminomancer committed Jul 11, 2022
1 parent bb67a43 commit 43f872a
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 39 deletions.
31 changes: 30 additions & 1 deletion JS/browserChromeBookmarkKeywords.uc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Browser Chrome Bookmark Keywords
// @version 1.0.2
// @version 1.1.0
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description Allow the creation of special keyword bookmarks with
Expand Down Expand Up @@ -114,6 +114,35 @@
};

function init() {
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
L10nCache: "resource:///modules/UrlbarUtils.jsm",
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm",
UrlbarProviderTopSites: "resource:///modules/UrlbarProviderTopSites.jsm",
UrlbarSearchOneOffs: "resource:///modules/UrlbarSearchOneOffs.jsm",
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.jsm",
BrowserUIUtils: "resource:///modules/BrowserUIUtils.jsm",
CONTEXTUAL_SERVICES_PING_TYPES: "resource:///modules/PartnerLinkAttribution.jsm",
ExtensionSearchHandler: "resource://gre/modules/ExtensionSearchHandler.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
ReaderMode: "resource://gre/modules/ReaderMode.jsm",
PartnerLinkAttribution: "resource:///modules/PartnerLinkAttribution.jsm",
SearchUIUtils: "resource:///modules/SearchUIUtils.jsm",
SearchUtils: "resource://gre/modules/SearchUtils.jsm",
UrlbarController: "resource:///modules/UrlbarController.jsm",
UrlbarEventBufferer: "resource:///modules/UrlbarEventBufferer.jsm",
UrlbarQueryContext: "resource:///modules/UrlbarUtils.jsm",
UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.jsm",
UrlbarValueFormatter: "resource:///modules/UrlbarValueFormatter.jsm",
UrlbarView: "resource:///modules/UrlbarView.jsm",
});

const UrlbarProvidersManager = gURLBar.view.controller.manager;

let UrlbarProviderBookmarkKeywords = UrlbarProvidersManager.getProvider("BookmarkKeywords");
Expand Down
19 changes: 10 additions & 9 deletions JS/oneClickOneOffSearchButtons.uc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name One-click One-off Search Buttons
// @version 1.8.0
// @version 1.8.1
// @author aminomancer
// @homepage https://github.com/aminomancer
// @description Restore old behavior for one-off search engine buttons. It
Expand Down Expand Up @@ -109,14 +109,15 @@
}
}
function toggleKeyNavCallback(disable) {
disable
? eval(
`gURLBar.view.controller.handleKeyNavigation = function ` +
gURLBar.view.controller.handleKeyNavigation
.toSource()
.replace(/(this\.\_lastQueryContextWrapper)/, `$1 && this.allowOneOffKeyNav`)
)
: delete gURLBar.view.controller.handleKeyNavigation;
if (disable) {
const lazy = { UrlbarUtils };
eval(
`gURLBar.view.controller.handleKeyNavigation = function ` +
gURLBar.view.controller.handleKeyNavigation
.toSource()
.replace(/(this\.\_lastQueryContextWrapper)/, `$1 && this.allowOneOffKeyNav`)
);
} else delete gURLBar.view.controller.handleKeyNavigation;
}

oneOffs.slider = oneOffs.buttons.parentElement;
Expand Down
14 changes: 1 addition & 13 deletions JS/openBookmarksHistoryEtcInNewTabs.uc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Open Bookmarks, History, etc. in New Tabs
// @version 1.2.0
// @version 1.2.1
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description In vanilla Firefox, browser.tabs.loadBookmarksInTabs only
Expand Down Expand Up @@ -29,19 +29,7 @@
if (window.PlacesUIUtils && !PlacesUIUtils._hasBeenModifiedForOBHNT) {
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
MigrationUtils: "resource:///modules/MigrationUtils.jsm",
OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
PlacesTransactions: "resource://gre/modules/PlacesTransactions.jsm",
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
PluralForm: "resource://gre/modules/PluralForm.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
Weave: "resource://services-sync/main.js",
});
XPCOMUtils.defineLazyGetter(lazy, "bundle", function () {
return Services.strings.createBundle("chrome://browser/locale/places/places.properties");
});
function getBrowserWindow(aWindow) {
return aWindow &&
Expand Down
63 changes: 59 additions & 4 deletions JS/urlbarMods.uc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Urlbar Mods
// @version 1.6.4
// @version 1.7.0
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description Make some minor modifications to the urlbar. See the code
Expand Down Expand Up @@ -530,6 +530,14 @@ class UrlbarMods {
let src2 = gURLBar.view._updateRow.toSource();
let src3 = TabToSearch.startQuery.toSource();
if (!src1.includes("client.clientType")) {
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
SyncedTabs: "resource://services-sync/SyncedTabs.jsm",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
UrlbarResult: "resource:///modules/UrlbarResult.jsm",
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
});
eval(
`RemoteTabs.startQuery = async function ` +
src1
Expand All @@ -538,6 +546,34 @@ class UrlbarMods {
);
}
if (!src2.includes("result.payload.clientType")) {
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
L10nCache: "resource:///modules/UrlbarUtils.jsm",
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm",
UrlbarProviderTopSites: "resource:///modules/UrlbarProviderTopSites.jsm",
UrlbarSearchOneOffs: "resource:///modules/UrlbarSearchOneOffs.jsm",
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.jsm",
BrowserUIUtils: "resource:///modules/BrowserUIUtils.jsm",
CONTEXTUAL_SERVICES_PING_TYPES: "resource:///modules/PartnerLinkAttribution.jsm",
ExtensionSearchHandler: "resource://gre/modules/ExtensionSearchHandler.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
ReaderMode: "resource://gre/modules/ReaderMode.jsm",
PartnerLinkAttribution: "resource:///modules/PartnerLinkAttribution.jsm",
SearchUIUtils: "resource:///modules/SearchUIUtils.jsm",
SearchUtils: "resource://gre/modules/SearchUtils.jsm",
UrlbarController: "resource:///modules/UrlbarController.jsm",
UrlbarEventBufferer: "resource:///modules/UrlbarEventBufferer.jsm",
UrlbarQueryContext: "resource:///modules/UrlbarUtils.jsm",
UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.jsm",
UrlbarValueFormatter: "resource:///modules/UrlbarValueFormatter.jsm",
UrlbarView: "resource:///modules/UrlbarView.jsm",
});
eval(
`gURLBar.view._updateRow = function ` +
src2
Expand All @@ -564,6 +600,15 @@ class UrlbarMods {
);
}
if (!src3.includes("uc_startQuery")) {
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
UrlbarView: "resource:///modules/UrlbarView.jsm",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
UrlbarProviderAutofill: "resource:///modules/UrlbarProviderAutofill.jsm",
UrlbarResult: "resource:///modules/UrlbarResult.jsm",
UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.jsm",
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
});
eval(
`TabToSearch.startQuery = async function uc_startQuery` +
src3
Expand Down Expand Up @@ -605,17 +650,27 @@ class UrlbarMods {
urlbarResultsSorting() {
let UnifiedComplete = gURLBar.view.controller.manager.muxers.get("UnifiedComplete");
let sortSrc = UnifiedComplete.sort.toSource();
if (!sortSrc.includes("getLogger"))
if (!sortSrc.includes(`UrlbarPrefs.get("showSearchSuggestionsFirst")`)) {
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
UrlbarProviderQuickSuggest: "resource:///modules/UrlbarProviderQuickSuggest.jsm",
UrlbarProviderTabToSearch: "resource:///modules/UrlbarProviderTabToSearch.jsm",
UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.jsm",
});
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
UrlbarUtils.getLogger({ prefix: "MuxerUnifiedComplete" })
);
eval(
`UnifiedComplete.sort = function ` +
sortSrc
.replace(/sort/, ``)
.replace(/logger/, `UrlbarUtils.getLogger({ prefix: "MuxerUnifiedComplete" })`)
.replace(
/showSearchSuggestionsFirst\: true/,
`showSearchSuggestionsFirst: UrlbarPrefs.get("showSearchSuggestionsFirst")`
`showSearchSuggestionsFirst: lazy.UrlbarPrefs.get("showSearchSuggestionsFirst")`
)
);
}
}
underlineSpaceResults() {
gURLBar.view._addTextContentWithHighlights = function (node, text, highlights) {
Expand Down
6 changes: 6 additions & 0 deletions resources/in-content/misc-content.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@
:root {
--uc-dummy-custom-property: initial;
}

@-moz-document domain("goatbots.com") {
.card-watcher-dialog input[type="number"] {
appearance: none !important;
}
}
23 changes: 14 additions & 9 deletions uc-app-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
#appmenu-moreTools-button > .toolbarbutton-text,
#appMenu-quit-button2 > .toolbarbutton-text,
#appMenu-restart-button2 > .toolbarbutton-text,
#appMenu-zoom-controls2 > .toolbarbutton-text,
#appMenu-zoom-controls > .toolbarbutton-text,
#appMenu-fxa-status2 :is(label, div),
:is(#appmenu-developer-tools-view, #PanelUI-developer-tools-view) toolbarbutton .toolbarbutton-text,
#appMenu_menu_openHelp > .toolbarbutton-text,
Expand All @@ -464,7 +464,7 @@
padding-inline-start: var(--arrowpanel-subviewbutton-iconic-gap, 8px) !important;
}

#appMenu-zoom-controls2::before {
#appMenu-zoom-controls::before {
content: "";
display: block;
width: 16px;
Expand All @@ -482,13 +482,13 @@
padding: 0 !important;
}

#appMenu-zoom-controls2
#appMenu-zoom-controls
:is(#appMenu-zoomReduce-button2, #appMenu-zoomEnlarge-button2, #appMenu-fullscreen-button2, #appMenu-zoomReset-button2):not([disabled], [open]):is(:hover, :focus-visible) {
background-color: var(--arrowpanel-dimmed) !important;
border-color: transparent !important;
}

#appMenu-zoom-controls2
#appMenu-zoom-controls
:is(#appMenu-zoomReduce-button2, #appMenu-zoomEnlarge-button2, #appMenu-fullscreen-button2, #appMenu-zoomReset-button2):not([disabled]):is([open], :hover:active) {
background-color: var(--arrowpanel-dimmed-further) !important;
}
Expand All @@ -497,7 +497,7 @@ panel .toolbaritem-combined-buttons {
margin-inline-end: 0 !important;
}

#appMenu-zoom-controls2 toolbarbutton {
#appMenu-zoom-controls toolbarbutton {
margin-inline: 4px !important;
border: 1px solid transparent !important;
min-height: 20px !important;
Expand All @@ -506,17 +506,18 @@ panel .toolbaritem-combined-buttons {
padding: 4px !important;
}

#appMenu-zoom-controls2 .toolbarbutton-icon {
#appMenu-zoom-controls .toolbarbutton-icon {
width: 12px !important;
height: 12px !important;
}

#appMenu-zoom-controls2 :where(.toolbarbutton-icon, .toolbarbutton-text) {
#appMenu-zoom-controls :where(.toolbarbutton-icon, .toolbarbutton-text) {
outline: none !important;
}

#appMenu-zoom-controls2 #appMenu-zoomReset-button2 {
#appMenu-zoom-controls #appMenu-zoomReset-button2 {
border: 1px solid var(--desaturate-dimmed) !important;
background-color: var(--uc-arrowpanel-very-faint) !important;
height: 20px !important;
border-radius: 10px !important;
padding: 0 4px !important;
Expand All @@ -527,7 +528,11 @@ panel .toolbaritem-combined-buttons {
-moz-box-pack: center !important;
}

#appMenu-zoom-controls2 #appMenu-zoomReset-button2 .toolbarbutton-text {
#appMenu-zoom-controls #appMenu-zoomReset-button2[disabled] {
opacity: 0.6 !important;
}

#appMenu-zoom-controls #appMenu-zoomReset-button2 .toolbarbutton-text {
margin-block: 1px !important;
margin-inline: 6px !important;
background: none !important;
Expand Down
8 changes: 5 additions & 3 deletions uc-panels.css
Original file line number Diff line number Diff line change
Expand Up @@ -1391,13 +1391,15 @@ toolbar button slider script. but just in case) */
}

#invalid-form-popup {
margin-inline-start: 0 !important;
margin-top: 65px !important;
margin-top: -4px !important;
margin-inline: 0 !important;
--panel-border-radius: var(--menupopup-border-radius) !important;
}

#invalid-form-popup description {
white-space: nowrap !important;
margin-block: 0 !important;
margin: 0 !important;
padding: 0 !important;
}

.menu-right {
Expand Down
1 change: 1 addition & 0 deletions uc-urlbar-results.css
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ so you might wanna turn the animation off. I might even make it off by default.
min-width: 0 !important;
min-height: 34px !important;
padding: 1px 0 !important;
margin: 0 !important;
}

.urlbarView-row[label] {
Expand Down

0 comments on commit 43f872a

Please sign in to comment.