Skip to content

Instantly share code, notes, and snippets.

@dmongeau
Last active December 16, 2015 05:19
Show Gist options
  • Save dmongeau/5384056 to your computer and use it in GitHub Desktop.
Save dmongeau/5384056 to your computer and use it in GitHub Desktop.
$('body').append('<iframe src="about:blank" name="extractIframe" id="extractIframe"></iframe>')
$('form[name=MyArchivedPlaylistsForm]').attr('target','extractIframe');
var binded = false;
var rowIndex = 1;
function loadNext() {
if(!binded) {
$('#extractIframe').bind('load',function() {
console.log('loaded');
if(!$('#extractIframe').contents().find('form[name=PlaylistContentForm] table').length) {
return;
}
var $table = $('#extractIframe').contents().find('form[name=PlaylistContentForm] table').clone();
$('body').append($table);
console.log('cloned');
rowIndex++;
loadNext();
})
binded = true;
}
if(!$('form[name=MyArchivedPlaylistsForm] table.data_table tr:eq('+rowIndex+') td:last input').length) {
return;
}
$('form[name=MyArchivedPlaylistsForm] table.data_table tr:eq('+rowIndex+') td:last input').click();
}
loadNext();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment