I am trying to fix a bug in a Chrome extension. The bug causes a alert dialog to be displayed seemingly at random. There is not one call to alert, confirm, or prompt in the extension source code. How do I find out why the alert dialog is being displayed?
Asked
Active
Viewed 255 times
0
-
You can redefine `window.alert` with `(...args) => { debugger; }` and see what happens. In case this is a web page, you may need to do it in [page context](/a/9517879). – wOxxOm Sep 16 '20 at 04:28
-
I do not know what this means: with (...args). Can you give the actual valid JavaScript syntax since I know "window.alert with (...args) => { debugger; }" is not valid JavaScript syntax? – Benilda Key Sep 18 '20 at 22:06
-
It is already JS syntax but split in two to make a coherent English sentence. Replace `with` with `=`. – wOxxOm Sep 19 '20 at 04:25
-
@wOxxOm Isn't there a function missing in there somewhere? Another source said to use the following. window.alert = function() { debugger; } There is no function in yours. – Benilda Key Sep 21 '20 at 08:16
-
I've used *arrow function syntax*. – wOxxOm Sep 21 '20 at 08:16