Skip to content
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

Enhanced Firefox Shortcuts and System Default Icon Support #55

Closed
wordpure opened this issue Mar 8, 2023 · 6 comments
Closed

Enhanced Firefox Shortcuts and System Default Icon Support #55

wordpure opened this issue Mar 8, 2023 · 6 comments
Assignees

Comments

@wordpure
Copy link
Contributor

wordpure commented Mar 8, 2023

Feature Request

  1. Add a shortcut to activate toolbar buttons for Firefox.
    Activating the toolbar button is a common action, but Firefox doesn't offer custom shortcuts after installing extensions like Chrome does.

    I hope to achieve an effect similar to the figure below through _execute_browser_action.

    图片

  2. Support for modifying extension shortcuts in the settings page.
    Currently, the steps for modifying extension shortcuts are cumbersome.

    图片

    I hope to achieve an effect similar to the figure below through commands.update() and commands.reset().

    图片

@wordpure wordpure changed the title Enhanced Firefox shortcut Enhanced Firefox shortcut(Version 0.8) Mar 8, 2023
@wordpure
Copy link
Contributor Author

wordpure commented Mar 8, 2023

By the way, can toolbar icons support system themes?

图片

@sixcious sixcious self-assigned this Mar 9, 2023
@sixcious
Copy link
Owner

Hi wordpure, thank you for this feature request!

1 - Maybe one could request in Bugzilla that Firefox add the _execute_browser_action shortcut as a default to match Chrome/Edge? I know some of the popular extensions have already done this, but it would honestly be a much better overall solution than making every single developer who ports to Firefox write extra Firefox-specific code. I'll consider this though.

2 - Unfortunately, that's because Firefox doesn't offer a way to programmatically open its Shortcuts page like Chrome does via chrome://extensions/shortcuts. This is actually a long-standing feature request on Bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=1538451

3 - Yes, but not in a clean way (IMO). This is one reason why I let you manually change the icon in the Options. The issue is that there isn't a good place to attach a prefers-color-scheme change listener without doing weird things like putting it in the injected content script. I think a new browser-provided API/listener would be the cleanest solution. The browser vendors (Chrome and Firefox) are actually discussing how to solve this very same problem, so hopefully there will be a solution soon:
w3c/webextensions#229

@sixcious sixcious changed the title Enhanced Firefox shortcut(Version 0.8) Enhanced Firefox Shortcuts and System Default Icon Support Mar 12, 2023
@wordpure
Copy link
Contributor Author

Thanks for trying out these feature requests🌹.

For the first point, I've filed a new pull request on Mozilla Connect in hopes of improving it.

Add a shortcut key to activate the toolbar button ... - Mozilla Connect

For the third point, can you add a more generic extension icon?

Currently, extensions must choose between a dark icon and a light icon, but it does not support automatic switching with browser themes. For me, who is used to the browser theme following the system, I have to manually switch the icon in the extension settings after the browser theme is changed.

It would be nice if there was an option in the settings to have an icon that works in both dark and light modes.

image

PS: The icon used by Default is icon.png in the img directory.

@sixcious
Copy link
Owner

Hi again wordpure!

Thanks for creating that post on Mozilla Connect! I gave you a thumbs up 👍

I've uploaded a new version on GitHub that has a couple of your feature requests implemented:
https://github.com/sixcious/infy-scroll#installation

  • I added the _execute_browser_action shortcut since it was a one line change in the manifest.json. I'll probably forget to do this for my other apps/extensions, so I hope Mozilla implements it as a default shortcut regardless.

  • I went ahead and added a new System Icon as an option (using the content script workaround).

Feel free to try it out and let me know how the System icon works for you. I don't use a theme that changes dynamically, so I hope it works well enough for you. If not, I'll look into adding icon.png as an option as you suggested.

Thanks again.

@wordpure
Copy link
Contributor Author

Thanks for your update and support for my post🌹.

The shortcut and System Icon work fine on my Firefox.

But I found a small problem: the label tag that wraps the System Icon, its for attribute actually uses the Dark Icon, so clicking will only switch to the Dark Icon.

图片

@sixcious
Copy link
Owner

sixcious commented Jul 1, 2023

Ah, I caught that one right around the time you posted. I tend to click on the radio inputs directly myself (since not everyone bothers to wrap for labels around the inputs!) so I didn't notice it immediately. Anyhow, this should be fixed in Version 8. I'm going to go ahead and close this out as I think I've addressed everything you brought up. For 2, we'll need to wait for Firefox to address the Bugzilla issue and add a way to link to their UI, like Chrome and Edge have done.

Thanks wordpure! 💜

@sixcious sixcious closed this as completed Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants