In the Chrome extension, determine if the user clicked the browser back or forward button

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.

+4
source share
1 answer

You can use the tabsAPI event onUpdatedif that is enough for you.

API HTML5 window.onpopstate. script, .

0

All Articles