How do I know if a user clicked the back / forward button in Chrome from my Chrome extension?
The only API that can give me such information is that chrome.webNavigation.onCommitted, if the "Back" or "Forward" button is pressed, it sends a NavigationQualifiercontaining the string 'forward_back'. The problem here is that I cannot distinguish between the two buttons.
chrome.webNavigation.onCommitted
NavigationQualifier
'forward_back'
You can use the tabsAPI event onUpdatedif that is enough for you.
tabs
onUpdated
API HTML5 window.onpopstate. script, .
window.onpopstate