使用Imacros从DialogBox消息复制密码

时间:2016-03-12 06:53:28

标签: javascript imacros

有没有办法使用imacros或greacemonkey从对话框消息中复制密码并将其粘贴到另一个页面? Please check the image link

1 个答案:

答案 0 :(得分:0)

了解如何通过“iMacros”中的JavaScript脚本界面解决问题。对于Firefox:

// just an imitation of your page js-dialog with one second delay
window.location.href = 'javascript:{window.setTimeout("window.location.href=\'javascript:{alert(\\"Bla bla bla ... DDA9B7 ... bla bla bla\\");}\'", 1000); undefined;}';

// macro that waits for the dialog
var ret = iimPlayCode("WAIT SECONDS=1.5");
// extract dialog text
if (ret < 0) 
    var otp = iimGetErrorText();
// extract otp
otp = otp.match(/\b[A-Z0-9]{6}\b/);
// pass it to another macro or display as done below
iimDisplay(otp);