Last active
July 25, 2016 18:46
-
-
Save the4dpatrick/d318ab2eab460ec891302f7a56ada870 to your computer and use it in GitHub Desktop.
Save/Load Selected Pokemon on PokeVision.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Visit PokeVision.com and select which pokemon you want to see via the filter dropdown. | |
// After you are happy with your selection, open the console[0] while PokeVision.com. | |
// Copy and paste either the save or load code below. | |
// [0] - https://developers.google.com/web/tools/chrome-devtools/debug/console/console-ui?hl=en#open-as-panel | |
// Save selected pokemon | |
var selectedPokemon = []; | |
$('.dropdown-menu.inner li.selected').each(function(_, el){ | |
selectedPokemon.push($(el).data('original-index')); | |
}); | |
localStorage.setItem('selectedPokemon', JSON.stringify(selectedPokemon)); | |
// Load selected pokemon | |
var selectedPokemon = JSON.parse(localStorage.selectedPokemon); | |
$('.actions-btn.bs-deselect-all.btn.btn-default').click(); | |
selectedPokemon.forEach(function(pokemonId) { | |
$('.dropdown-menu.inner li[data-original-index=' + pokemonId + '] a').click(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment