How to capture browser menu selection events

How to capture browser menu selection events

I have to expand all collapsed rows of a table when user tries to search for a string using Ctrl + F or using menu item Find. I am able to do this when user hits Ctrl + F, but not sure how to achieve the same when user selects menu item Find.
Basically, If I am searching for a string using Ctrl + F or using menu item Find and if any row is hidden/collapsed (and if this hidden row contains the required string), then browser will not be able to find the required string as its hidden. So my idea is to capture the Ctrl+F event and expand all the rows. I am able to capture the Ctrl+F. Same thing I want to achieve when user uses menu item Find
 
Thoughts