Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
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