Skip to content

nmarcopo/showdownSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokemon Showdown Team Sync logo

Build Status

This is a chrome extension that can sync teams between browsers on Pokemon Showdown using Chrome sync data.

Demo

Gif Demonstration of the extension

Motivation

Pokemon Showdown includes a teambuilder where users can create teams of Pokemon and battle with them using their online simulator. I use several different computers regularly, and sadly Showdown stores its teams per-browser using localStorage in Javascript. This extension will let users sync their Showdown teams between browsers without storing teams on Google Docs, email, pokepastes, etc.

Why a Chrome Extension?

  • Chrome extensions are really convenient (sits in the corner of your browser)
  • Chrome has a simple API to sync data between browsers
  • Can backup/restore without needing to import/export a team manually(!)

Limitations

  • Hard limit of 102,400 bytes synced. Check the Chrome extension docs for more information.
    • This is enough for about 140 full teams of 6 Pokemon.
    • I might add an option to save to Google Drive if there's enough interest for higher capacity syncing.
  • Buggy/disorganized code. I just made this in a couple of days and I haven't rigorously tested it, but if you have a problem make sure you file a GitHub issue!
  • You need to be signed into Google Chrome with a Google account and have Sync enabled.

TODO:

  • Add delete button to backed up teams
  • Make options page look nicer
  • Add logo
  • Load icons manually when user isn't on the team page already
  • Backups when icons were not loaded manually still store the icons
  • Publish publicly to Chrome Web Store
  • Add option to back up all if there's enough space
    • Previously thought this wouldn't be possible with rate limit but it appears you can do bulk write operations with chrome storage set method
  • Add option to restore all from backup
  • Clicking "Backup" rearranges the order of the available cards
  • Small ordering bugs - sometimes the order of the cards is unpredictable
  • Optimize the code to run faster
  • Hide the injected code from view
  • Fix Javascript error when running room.update() without teambuilder open
  • Check to make sure we haven't exceeded limits in Chrome sync
  • Refresh restore list with button
  • Show user's account info so they can make sure they're syncing to the same account
  • Icons in the "restore" list are wrong after refreshing many times. Potentially an async issue or IP getting flagged for requesting assets so many times
  • Sometimes the teams are not recognized as duplicates in Sync and Local
    • This happens because gens are not assigned to the JSON until after room.update() is called, apparently
  • Give option to update the backed up team by name
    • Maybe it would be easier to use the team name instead of the hash for the key?
  • Somehow show the team details beyond just the name and icons

Release history

  • 0.1.6: Bug fixes: search bar and delete backups
  • 0.1.5: Added clear search button, bug fixes
  • 0.1.4: Added FAQ link and display synced email
  • 0.1.3: Ensure limits haven't been exceeded for sync storage
  • 0.1.2: Added option to force an update if not already downloaded
  • 0.1.1: Fix bug when user backs up team while editing it, update logo
  • 0.1.0: Initial release

Credits

Big thanks to the following resources:

And the hundreds of other StackOverflow pages and random JavaScript references I used but can't recall.

FAQs

  • Q: My teams are not syncing!

    • A: Make sure that you are connected to the correct email on both of your browsers. The "Connected to email" part of the extension should be the same on both browsers' extensions:

    Connected to email screenshot

    See the next question if the emails are different.

  • Q: My "Connected to email" emails are different between browsers!

    • A: You'll need to sign into the same account on both browsers. See this guide for information on how to sign in to Google Chrome.
  • Q: My teams are not syncing, and the connected emails are the same!

    • A: First, make sure you've waited a minute for your teams to sync, then close and re-open the extension. If they still haven't synced, make sure you have sync enabled on your account. See this support article for information on how to turn sync on.