I am making a Google Chrome Extension called Duolingo Notes, this extension can help the Duolingo learner bookmark the sentence in Duolingo courses.
I would like to use a ContextMenu (the chrome.extensions.contextMenus
API) in a Chrome extension that allows the user to take some action on the current page, e.g. save some sentence from that page.
When the user clicks on my ContextMenu item (Add to Duolingo Notes), I am trying to determine my options, and/or the best way, in my scenario to provide feedback to the user, that the action was successful or unsuccessful.
There are some potential solutions may help us with this.
1. Using notification
Notifications is OK, but I don't want to overuse notification, otherwise, the user will see a lot of notifications in their notifications popup.
2. Adding an HTML "alert" div
in the current page's DOM
Hijacking the DOM maybe not a good idea. And I saw Doulingo actually detects that and output 'We are hiring' in the debug console.
3. Showing a popup for/through browserAction
Chrome only provides setPopup method which can only set the popup but can not display the popup. Is any way we can force Chrome to display the popup for browserAction?
4. Showing a badge Chrome provides setBadgeText method which can set a text in the browserAction. Below is any.do extension's browserAction button with badge.
Any.Do does not have any feedback except for this badge when the user adds a note. The problem of this solution is we can not provide any error message when something goes wrong.
What are some common ways to do this? I have googled that and have not found the good practice. Would you please offer some help if you are happy to. Thanks in advanced.
Jake