Skip to content

Instantly share code, notes, and snippets.

@dhl
Last active July 3, 2018 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhl/fdd92c61aad7967752928f0d11de117d to your computer and use it in GitHub Desktop.
Save dhl/fdd92c61aad7967752928f0d11de117d to your computer and use it in GitHub Desktop.
Quick and dirty hack to verify a long list of devices in Riot's "Unknown Device" dialog.
/*
Quick and dirty hack. USE AT YOUR OWN RISK.
*/
function clickVerifyInDialog() { $('.mx_Dialog_primary').click() }
function verifyFirstKey() { $('.mx_UnknownDeviceDialog .mx_MemberDeviceInfo_verify').click() }
function hasKeyToVerify() { return $('.mx_UnknownDeviceDialog .mx_MemberDeviceInfo_verify') }
function verificationIsDisplayed() {
return $('#mx_BaseDialog_title').innerHTML == 'Verify device'
}
while (hasKeyToVerify()) {
verifyFirstKey()
if (verificationIsDisplayed()) {
clickVerifyInDialog()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment