Earlier I used to intercept and remove unnecessary alerts in V2. However no way I'm able to do it in V3.
Earlier I used to do like this:
file:inject.js
do_embed_code(injected_code);
function injected_code()
{
var gg_original_alert = window.alert;
window.alert =
function (msg)
{
console.log("Here is alert msg=", msg);
}
}
function do_embed_code(func_name)
{
var s = document.createElement('script');
s.textContent = '('+func_name.toString ()+')();';
document.documentElement.appendChild(s);
console.log("Inject finished", new Date().getTime());
}
manifest.json:
"content_scripts": [
{
"run_at": "document_start",
"all_frames": true,
"matches": ["*://*/*", "https://*/*"],
"js": ["inject.js"]
}
What's the way to do?