Chrome gives you the option of blocking additional alert boxes on a website.
How exactly do they do this? Do they directly manipulate your javascript, because somewhere in your code, you will have alert('hello'); So what happens to this code once the user ticks “prevent this site creating additional dialogs”?
think of it this way, your js interacts with browser’s and then browser uses your OS’s APIs to do something which it cannot do by itself. Browser is the middle man and it simply stops any further calls to it’s internal
alertfunction (which ultimately shows the dialogue) from that domain/tab.