Can I create a Google chrome extension to prevent the page from doing an alert()
?
Yes you can, alert() is just a JavaScript method, you can override its functionality by doing.
window.alert = function alert(msg) {
console.log('Hidden Alert ' + msg);
};
Just remember to run that content script at document_start within the manifest via run_at manifest content script modifier.
I believe there is an extension that just does that. The developer names it Nice Alert. https://chrome.google.com/extensions/detail/ehnbelnegmgdnjaghgomaakjcmpcakhk