diff --git a/JS/privateTabs.uc.js b/JS/privateTabs.uc.js index b86b617..91bfb8f 100644 --- a/JS/privateTabs.uc.js +++ b/JS/privateTabs.uc.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Private Tabs -// @version 1.2.1 +// @version 1.2.2 // @author aminomancer // @homepage https://github.com/aminomancer // @description An fx-autoconfig port of Private Tab by xiaoxiaoflood. Adds @@ -48,12 +48,14 @@ class PrivateTabManager { // the internal duplicateTab method doesn't pass the skipAnimation parameter // to addTrustedTab. so we need to make our own function, which requires us // to access some private objects. - let { SessionStoreInternal, TAB_CUSTOM_VALUES } = ChromeUtils.import( + // eslint-disable-next-line mozilla/use-chromeutils-import + let { SessionStoreInternal, TAB_CUSTOM_VALUES } = Cu.import( "resource:///modules/sessionstore/SessionStore.jsm" ); this.SSI = SessionStoreInternal; this.TAB_CUSTOM_VALUES = TAB_CUSTOM_VALUES; XPCOMUtils.defineLazyModuleGetters(this, { + Management: "resource://gre/modules/Extension.jsm", TabState: "resource:///modules/sessionstore/TabState.jsm", TabStateFlusher: "resource:///modules/sessionstore/TabStateFlusher.jsm", ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm", @@ -322,19 +324,17 @@ class PrivateTabManager { ); } - let { UUIDMap } = ChromeUtils.import("resource://gre/modules/Extension.jsm"); + const { WebExtensionPolicy } = Cu.getGlobalForObject(Services); let TST_ID = "treestyletab@piro.sakura.ne.jp"; - this.TST_UUID = UUIDMap.get(TST_ID, false); - - if (this.TST_UUID) this.setTstStyle(this.TST_UUID); - if (AddonManager && location.href === "chrome://browser/content/browser.xhtml") { - AddonManager.addAddonListener({ - onInstalled: addon => { - if (addon.id == TST_ID) this.setTstStyle(UUIDMap.get(TST_ID, false)); - }, - onUninstalled: addon => { - if (addon.id == TST_ID) this.sss.unregisterSheet(this.TST_STYLE.url, this.TST_STYLE.type); - }, + this.setTstStyle(WebExtensionPolicy.getByID(TST_ID)?.getURL()); + if (location.href === "chrome://browser/content/browser.xhtml") { + this.Management.on("ready", (_ev, extension) => { + if (extension.id === TST_ID) this.setTstStyle(extension.getURL()); + }); + this.Management.on("uninstall", (_ev, extension) => { + if (extension.id === TST_ID && this.TST_STYLE) { + this.sss.unregisterSheet(this.TST_STYLE.uri, this.TST_STYLE.type); + } }); } @@ -603,17 +603,20 @@ class PrivateTabManager { }; } - setTstStyle(uuid) { + setTstStyle(baseURL) { + if (!baseURL) return; this.TST_STYLE = { - url: Services.io.newURI( + uri: Services.io.newURI( "data:text/css;charset=UTF-8," + encodeURIComponent( - `@-moz-document url-prefix(moz-extension://${uuid}/sidebar/sidebar.html) { .tab.contextual-identity-firefox-container-${this.container.userContextId} .label-content { text-decoration: underline !important; text-decoration-color: -moz-nativehyperlinktext !important; text-decoration-style: dashed !important; } .tab.contextual-identity-firefox-container-${this.container.userContextId} tab-favicon { border-bottom: 1px dashed -moz-nativehyperlinktext !important;}}` + `@-moz-document url-prefix(${baseURL}sidebar/sidebar.html) { .tab.contextual-identity-firefox-container-${this.container.userContextId} .label-content { text-decoration: underline !important; text-decoration-color: -moz-nativehyperlinktext !important; text-decoration-style: dashed !important; } .tab.contextual-identity-firefox-container-${this.container.userContextId} tab-favicon { border-bottom: 1px dashed -moz-nativehyperlinktext !important;}}` ) ), type: this.sss.USER_SHEET, }; - this.sss.loadAndRegisterSheet(this.TST_STYLE.url, this.TST_STYLE.type); + if (!this.sss.sheetRegistered(this.TST_STYLE.uri, this.TST_STYLE.type)) { + this.sss.loadAndRegisterSheet(this.TST_STYLE.uri, this.TST_STYLE.type); + } } } diff --git a/resources/in-content/system.css b/resources/in-content/system.css index 8e4d92a..7a3e026 100644 --- a/resources/in-content/system.css +++ b/resources/in-content/system.css @@ -467,6 +467,12 @@ word-wrap: anywhere; } + .onboardingContainer.featureCallout .screen[pos="callout"] .section-main .main-content, + .onboardingContainer.featureCallout.arrow-inline-end::before { + background-color: var(--newtab-background-color-secondary) !important; + border-color: var(--fxview-contrast-border) !important; + } + @-moz-document regexp("^about:blocked.*") { html:root, html:root * { diff --git a/uc-extensions.css b/uc-extensions.css index ef0c49a..e54f2ef 100644 --- a/uc-extensions.css +++ b/uc-extensions.css @@ -58,11 +58,16 @@ menupopup#viewSidebarMenu } /* Want My RSS */ -:is(.pageAction-panel-button, .urlbar-page-action)[actionid="_4d567245-e70d-466a-bb2f-390fc7fb25c2_"] { +:is(.pageAction-panel-button, .urlbar-page-action)[actionid="_4d567245-e70d-466a-bb2f-390fc7fb25c2_"i] { --pageAction-image-16px: url(chrome://userchrome/content/material/rss.svg) !important; --pageAction-image-32px: url(chrome://userchrome/content/material/rss.svg) !important; } +:is(.webextension-browser-action, .eom-addon-button)[data-extensionid="{4d567245-e70d-466a-bb2f-390fc7fb25c2}"i] + .toolbarbutton-icon { + list-style-image: url(chrome://userchrome/content/material/rss.svg); +} + /* sort bookmarks */ :is(.webextension-browser-action, .eom-addon-button)[data-extensionid="sort-bookmarks@heftig"] .toolbarbutton-icon { diff --git a/uc-misc.css b/uc-misc.css index 68f159d..fc8e5f2 100644 --- a/uc-misc.css +++ b/uc-misc.css @@ -658,7 +658,7 @@ toolbar:not(#PersonalToolbar) .toolbarbutton-1:focus-visible > .toolbarbutton-ba .urlbarView-tip-button { font-family: SF Pro Text, SF Arabic, Segoe UI, sans-serif !important; - font-weight: var(--uc-font-weight-bold, 600) !important; + font-weight: var(--uc-font-weight-semibold, 600) !important; } .popup-notification-body input[type="password"] { diff --git a/uc-popups.css b/uc-popups.css index c1767d1..a64d2cf 100644 --- a/uc-popups.css +++ b/uc-popups.css @@ -1926,7 +1926,7 @@ link[href="chrome://global/content/printPagination.css"] background-color: var(--uc-places-cell-hover-bgcolor) !important; } - #viewGroup > radio[focused="true"] .radio-label-box { + #viewGroup:focus-visible > radio[focused="true"] .radio-label-box { outline: var(--global-focus-outline, auto) !important; } @@ -2227,4 +2227,12 @@ link[href="chrome://global/content/printPagination.css"] #perm-microphone-row .permissionLabel { background-image: url(chrome://userchrome/content/notifications/microphone.svg); } + + @supports -moz-bool-pref("userChrome.css.mac-ui-fonts") { + strong, + .header, + .permissionLabel { + font-weight: var(--uc-font-weight-extrabold, 600) !important; + } + } } diff --git a/uc-urlbar-results.css b/uc-urlbar-results.css index 027e032..6bf39d8 100644 --- a/uc-urlbar-results.css +++ b/uc-urlbar-results.css @@ -468,15 +468,6 @@ by underlining them (requires urlbarMods.uc.js) */ margin: 0 !important; } -.urlbarView .urlbarView-row[type="tip"] > .urlbarView-row-inner { - border: none !important; - padding-block: 6px !important; - margin: 0 !important; - min-height: unset !important; - max-height: -moz-fit-content !important; - height: unset !important; -} - .urlbarView-tip-button, .urlbarView-tip-help { margin-block: unset !important; @@ -492,8 +483,12 @@ by underlining them (requires urlbarMods.uc.js) */ } .urlbarView-tip-button { - padding-inline: 6px !important; - padding-block: 3px !important; + padding-inline: 10px !important; + padding-block: 4px !important; + margin-inline-end: -3px !important; + font-size: 0.9em !important; + background-clip: revert !important; + min-width: revert !important; } .urlbarView-tip-help { @@ -525,20 +520,6 @@ by underlining them (requires urlbarMods.uc.js) */ margin: 0 !important; } -.urlbarView-row[type="tip"] > .urlbarView-row-inner > .urlbarView-favicon, -.urlbarView-row[type="tip"] > .urlbarView-row-inner > .urlbarView-title, -.urlbarView-row[type="tip"] > .urlbarView-row-inner > .urlbarView-help, -.urlbarView-tip-button { - margin-block-end: revert !important; -} - -.urlbarView-row[type="tip"] > .urlbarView-row-inner > .urlbarView-title { - white-space: normal; - flex-basis: revert !important; - flex-grow: 0 !important; - flex-shrink: 0 !important; -} - .urlbarView-row .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-title-separator, .urlbarView-dynamic-calculator-action::before, .urlbarView-dynamic-unitConversion-action::before { @@ -586,7 +567,7 @@ by underlining them (requires urlbarMods.uc.js) */ .urlbarView-row[has-url] .urlbarView-title, .urlbarView-row:not([has-action]) .urlbarView-title:has(strong), .urlbarView-row .urlbarView-tag, -.urlbarView-row:where([type="tabtosearch"], [type="tokenaliasengine"]) .urlbarView-title, +.urlbarView-row:where([type="tabtosearch"], [type="tokenaliasengine"], [type="tip"]) .urlbarView-title, .urlbarView-row:not([has-url]) .urlbarView-title[data-l10n-id="urlbar-result-action-search-w-engine"], .urlbarView-tail-prefix { @@ -600,7 +581,7 @@ by underlining them (requires urlbarMods.uc.js) */ color: var(--panel-shortcut-color); } -.urlbarView-row:where([type="tabtosearch"], [type="tokenaliasengine"])[selected] .urlbarView-title, +.urlbarView-row:where([type="tabtosearch"], [type="tokenaliasengine"], [type="tip"])[selected] .urlbarView-title, .urlbarView-row[has-action][selected] .urlbarView-title strong, .urlbarView-row[has-action][selected] .urlbarView-title[isurl], .urlbarView-row[type="bookmark"][selected]:not([has-url]) .urlbarView-title, @@ -704,7 +685,8 @@ by underlining them (requires urlbarMods.uc.js) */ .urlbarView-row[engine="Google"]:is([type="tabtosearch"], [type="tokenaliasengine"]) .urlbarView-favicon, -.urlbarView-row[engine="Google"][type="search"] .urlbarView-favicon[src]:not([src^="chrome"]) { +.urlbarView-row[engine="Google"][type="search"] .urlbarView-favicon[src]:not([src^="chrome"]), +.urlbarView-row[type="tip"] .urlbarView-favicon[src="moz-extension://cd4aad93-9726-49dd-a5cd-9e5f5c4d76f4/favicon.ico"] { box-sizing: border-box !important; background: url(chrome://userchrome/content/engines/google.svg) no-repeat !important; width: 16px !important;