Sunday 15 June 2014

javascript - how to get type of popup dialog by Chrome Extension -



javascript - how to get type of popup dialog by Chrome Extension -

in chrome extension, add together this:

chrome.debugger.onevent.addlistener(function(sender, method, params){ if(method == "page.javascriptdialogopening") { console.log(params.message); } }

in way, chrome extension can content of dialog, example:

when chrome page show alert dialog (like "hello world"), console show alert content params.message (which string "hello world"). same prompt dialog , confirm dialog.

but how can type of dialog?

i mean, when dialog pops up, chrome extension can dialog type "alert", "prompt" or "confirm".

ps:in old ways, utilize plugin dialog type windows dialog type. chrome version goes up, way failed, seems dialog not show window dialog contained in webpage.

javascript google-chrome google-chrome-extension

No comments:

Post a Comment