I am making a Chrome extension that runs a code when a web page's specific alert dialog is shown to user. (By alert dialog, I mean Javascript's 'window.alert()') I want to detect the alert dialog's text, and run a code. Is there any way for Chrome extension to detect alert dialog's text shown by the web page? Or any other way to detect alert dialog?
For example, a foreign website alerts a user by window.alert("Banana pie")
.
My extension will detect 'Banana' and run a code.