Skip to content

Instantly share code, notes, and snippets.

@dwelch2344
Created April 2, 2017 04:16
Show Gist options
  • Save dwelch2344/0eb85a8580c3a20e4efc2d520a38bfb6 to your computer and use it in GitHub Desktop.
Save dwelch2344/0eb85a8580c3a20e4efc2d520a38bfb6 to your computer and use it in GitHub Desktop.
$sel = $;
function deleteThem() {
var $injector = angular.injector(['ng']);
$injector.invoke(function($timeout) {
$sel('[aria-label^=" Incoming call from "][aria-label^=" Missed call from "],[aria-label^=" Outgoing call to "]').click();
console.log('selected')
$timeout(() => {
$sel('[aria-label="More options"]').click();
console.log('options')
}, .5 * 1000)
.then( () => {
return $timeout(() => {
$sel('[aria-label="Archive"][role="menuitem"]').click();
console.log('archive')
}, 1 * 1000);
})
.then( () => {
return $timeout(() => {
$sel('[aria-label="Calls"]').click();
console.log('Calls')
}, 1 * 1000);
})
.then( () => {
console.log('end')
var len = $sel('.md-virtual-repeat-offsetter').children.length
if( len > 0 ){
return $timeout(() => {
console.log('Found', len, '- Restarting!')
deleteThem()
}, 1 * 1000);
}
})
});
}
deleteThem()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment