/clear_pico8_save_data.js Secret
Created
June 14, 2021 22:18
Star
You must be signed in to star a gist
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
/* | |
To clear your save data for Too Many Daves: | |
1. open the javascript console (f12) | |
2. change the "javascript context" (near the top left of the console) from "top" to "index.html - v6p9d9t4.ssl.hwcdn.net" | |
(This is the iframe itch.io uses to run the game. We need to change our javascript context so that we have access to its data storage) | |
3. paste this code into the console and run it; it should say "save data successfully deleted" | |
4. refresh the page. the game should start you back in the first level | |
*/ | |
filename_to_delete="/user_data/cdata/pancelor_toomanydavesjam_0.p8d.txt" | |
if (window.location.host==="pancelor.itch.io") { | |
console.error("you need to manually change the javascript context from 'top' to 'index.html'") | |
} else { | |
openreq=indexedDB.open("/user_data") | |
openreq.onerror=console.error | |
openreq.onsuccess=()=>{ | |
let db=openreq.result | |
let transaction=db.transaction("FILE_DATA","readwrite") | |
let req=transaction.objectStore("FILE_DATA").delete(filename_to_delete) | |
req.onerror=console.error | |
req.onsuccess=()=>console.log("save data successfully deleted") | |
}; null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment