-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(command-line): hide Ctrl/Cmd + Shift + P hint on Firefox (@d1rshan) #7690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,11 @@ import { H2, H3 } from "../common/Headers"; | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export function AboutPage(): JSXElement { | ||||||||||||||||||||||||||
| const isOpen = () => getActivePage() === "about"; | ||||||||||||||||||||||||||
| const isFirefox = window.navigator.userAgent | ||||||||||||||||||||||||||
| .toLowerCase() | ||||||||||||||||||||||||||
| .includes("firefox"); | ||||||||||||||||||||||||||
|
Comment on lines
21
to
+25
|
||||||||||||||||||||||||||
| export function AboutPage(): JSXElement { | |
| const isOpen = () => getActivePage() === "about"; | |
| const isFirefox = window.navigator.userAgent | |
| .toLowerCase() | |
| .includes("firefox"); | |
| const isFirefoxBrowser = (): boolean => | |
| typeof window !== "undefined" && | |
| window.navigator.userAgent.toLowerCase().includes("firefox"); | |
| export function AboutPage(): JSXElement { | |
| const isOpen = () => getActivePage() === "about"; | |
| const isFirefox = isFirefoxBrowser(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -724,15 +724,13 @@ export async function update( | |
| CustomBackgroundFilter.updateUI(); | ||
|
|
||
| const userAgent = window.navigator.userAgent.toLowerCase(); | ||
| const modifierKey = | ||
| userAgent.includes("mac") && !userAgent.includes("firefox") | ||
| ? "cmd" | ||
| : "ctrl"; | ||
| const isFirefox = userAgent.includes("firefox"); | ||
| const modifierKey = userAgent.includes("mac") && !isFirefox ? "cmd" : "ctrl"; | ||
|
|
||
| const commandKey = Config.quickRestart === "esc" ? "tab" : "esc"; | ||
| qs(".pageSettings .tip")?.setHtml(` | ||
| tip: You can also change all these settings quickly using the | ||
| command line (<kbd>${commandKey}</kbd> or <kbd>${modifierKey}</kbd> + <kbd>shift</kbd> + <kbd>p</kbd>)`); | ||
| command line (${isFirefox ? `<kbd>${commandKey}</kbd>` : `<kbd>${commandKey}</kbd> or <kbd>${modifierKey}</kbd> + <kbd>shift</kbd> + <kbd>p</kbd>`})`); | ||
|
Comment on lines
731
to
+733
|
||
|
|
||
| if ( | ||
| customLayoutFluidSelect !== undefined && | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isFirefox/modifierKeyuser-agent parsing is duplicated across this PR (also in settings.ts/AboutPage.tsx). Consider extracting a small shared helper (e.g.,utils/browserorutils/shortcuts) so future browser/platform tweaks only need changing in one place.