To set up the helper script, we need to run it on the background page for the extension. Here's one way to do that:
-
Navigate to chrome://extensions/
-
Click on the developer mode checkbox on the top right of the extensions page.
-
Click on the background page link that should appear underneath the TagProReplays extension entry on the extensions page.
-
A screen that looks like the below should open up. If it doesn't look exactly like this, then click on the "Console" option at the top of the window.
-
Copy the contents of the other file in this Gist into the console and press enter.
After pasting the code into the console (like above) or running it as a snippet, you have access to a Helper that wants to help you get access to your replays. The Helper has a few functions. For each function there is an example of how you should enter it into the console (with bracketed sections indicating places that you should replace the values with values that you want), and then an example, if needed. For each of these, just type or copy the code into the console and run it, after doing the steps above.
Helper.show_number_of_replays()
Running this will, after a moment, print out the number of replays that are in the database. You want to run this first to ensure that you even have any replays to retrieve.
Helper.download_replays([num])
This downloads num
replays. For example, to download 100 replays:
Helper.download_replays(100)
Messages will appear in the console informing you of the progress of your request. You can put any number of replays here and it will download. If the size of the replays would exceed 150MB then they will be downloaded in separate zip files, each will have a maximum of 150MB of replays. The function will continue until it reaches the number of replays that you specify or the last replay in the database that hasn't been downloaded, whichever comes first.
Helper.delete_downloaded()
This deletes the replays that you have downloaded from the database. Make sure that the downloaded replays are alright before doing this!
Don't run one function until the other one is finished. If you're trying to retrieve your replays so you can get your extension working again, then the following process can get you right:
- Get the code above working on the background page.
- download replays, start small (50-100) and after each round delete the downloaded replays.
- continue doing this until there are no more replays left.
Theoretically, once that is done you should be able to import a reasonable amount of replays into the extension once again and have it function, but there's no guarantee that some other data in the extension isn't still around and could cause problems. A safer bet would be to uninstall the extension completely and reinstall it from the Chrome Web Store. This should ensure that all data that was associated with the old replays is gone (except the data you downloaded!)