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 sentences 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.
Some potential solutions may help us with this.
1. Using notification
Notifications are OK, but I don't want to overuse notifications, 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 may not be 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 the 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 with 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.