-
Notifications
You must be signed in to change notification settings - Fork 56
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
Proposal: onDoubleClicked for browserAction
#196
Comments
Here's a functional demo of a double click action in an MV3 extension that's heavily cribbed from Turn Off the Lights. |
That is my code (see my Github profile icon). That is conflicting information, because according to this article it is recommended to move away from
Source: https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/#alarms I did move to Thank you. It is good to hear from you @dotproto that the current manifest v2 doubleclick code will not affect this issue for the service worker manifest v3. |
This was discussed during today's WECG meeting. The meeting notes are in the linked PR and will be merged with the repo within two weeks. Stefan - it seems that you're primarily interested in a new API because of the belief that |
The proposal for the new API would be useful to reduce the code size. And add some new capabilities to improve the web experience. As I mentioned before, it is good to hear that the smaller |
I'm closing this issue because we have discussed this topic and decided to not implement the requested method, as explained at the "Proposal: onDoubleClicked for browserAction" section of https://github.com/w3c/webextensions/blob/main/_minutes/2022-04-14-wecg.md. While "Long press" could potentially be an alternative on mobile to double-click on desktop, it does not address the mentioned "affordance" issue, i.e. there not being a way for the user to know that long-press/double-click doing anything. |
Motivation
The use of Manifest V2 to Manifest V3 diminishes the good web experience. And create some inconvenience for existing users using the DoubleClick action on my browser extensions.
The currently available listener for a click:
browser.browserAction.onClicked.addListener(listener)
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction/onClicked
Due to the lack of a support timer (
setTimeout
andsetInterval
) in the service worker, there is no way to detect the user double-clicking. Even with thechrome.alarms.create("MyDelay", {when: Date.now() + 1 * 3000})
you can get it to work in seconds. However, the documentation said once you have published the Chrome extension, the actual interval will be rounded up to 1 minute even if you set a smaller value like 3 seconds (3000ms).Source: https://developer.chrome.com/docs/extensions/reference/alarms/#method-create
The following browser extensions use the double click function:
Zoom browser extension (Google Chrome, Safari, Firefox, Opera, Microsoft Edge):
Double click on the browser action button to zoom in, and a single click to zoom out of the current page.
https://chrome.google.com/webstore/detail/zoom-for-google-chrome/lajondecmobodlejlcjllhojikagldgd
Turn Off the Lights browser extension (Google Chrome, Safari, Firefox, Opera, Microsoft Edge):
That to open the mini settings panel, to adjust live the current dark layer opacity and his color.
https://chrome.google.com/webstore/detail/turn-off-the-lights/bfbmjmiodbnnpllbbbfblcplfjjepjdn
Full Screen browser extension (Google Chrome, Safari, Firefox, Opera, Microsoft Edge):
That to open the mini settings panel, to get more control on how the window should be ordered (side by side, matrix, etc.)
https://chrome.google.com/webstore/detail/full-screen-for-google-ch/gmimocjjppdelmhpcmpkhekmpoddgima
Proposal
browser.browserAction.onDoubleClicked.addListener(listener)
or allow the
chrome.alarms.create("MyDelay", {when: Date.now() + 1 * 3000})
for seconds.It will extend the user experience for desktop and mobile web browsers. And create a convenient way for mobile users to get more control on a small device. Such as opening the options page of that browser extension.
The text was updated successfully, but these errors were encountered: