I wanted to be able to take my browser version of the game specifically this one
shar-wasm.cjoseph.workers.dev
and move it to another laptop or just save it in general. I will admit I used AI to help me get this one as I’m only proficient in Python and can do a little c++ but am absolutely brain dead with JAVA
Open up your dev tools on browser for windows this is (F12) and in console paste this code. (Disregard the /// that’s just for formatting)
/
/
/
(async () => {
try {
const dbName = "save-data";
const req = indexedDB.open(dbName);
req.onsuccess = (event) => {
const db = event.target.result;
const storeName = db.objectStoreNames[0]; // Auto-grab the storage area
if (!storeName) {
console.error("The save-data database appears to be empty.");
return;
}
const transaction = db.transaction([storeName], 'readonly');
const store = transaction.objectStore(storeName);
const keysReq = store.getAllKeys();
keysReq.onsuccess = () => {
console.log("Found files inside database:", keysReq.result);
// Look for your save slot file
const saveKey = keysReq.result.find(k => k.includes('save') || k.includes('.rad'));
if (!saveKey) {
console.error("No save file found in the database lists. Make sure you have clicked save in the game's menu.");
return;
}
store.get(saveKey).onsuccess = (e) => {
const record = e.target.result;
// Extract binary data contents depending on how the store structured it
const data = record.contents || record;
const blob = new Blob([data], {type: "application/octet-stream"});
const a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.download = "save0.rad";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
console.log(`Successfully downloaded: ${saveKey}`);
};
};
};
req.onerror = () => console.error("Could not open the save-data database.");
} catch(err) { console.error("Extraction error:", err); }
})();
/
/
/
It should prompt you to save your save file. Now in your new browser that does not have your save data open up the console with (F12) and paste this code
/
/
/
(() => {
// Create a temporary hidden file picker on the webpage
const picker = document.createElement('input');
picker.type = 'file';
picker.style.display = 'none';
picker.onchange = (e) => {
const file = e.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onload = (event) => {
const buffer = event.target.result;
const uint8 = new Uint8Array(buffer);
// Open the target database
const req = indexedDB.open('save-data');
req.onsuccess = (evt) => {
const db = evt.target.result;
const storeName = db.objectStoreNames[0];
if (!storeName) {
console.error("Target database is missing the storage slot. Try starting/saving a quick game in this browser first to initialize it.");
return;
}
const transaction = db.transaction([storeName], 'readwrite');
const store = transaction.objectStore(storeName);
// Write the file data back into 'save1'
const putReq = store.put(uint8, 'save1');
putReq.onsuccess = () => {
console.log("Save file successfully imported to the new browser! Refresh the page to load your game.");
alert("Import successful! Refresh the page to load your save.");
};
putReq.onerror = () => console.error("Failed to write the save data to the database.");
};
req.onerror = () => console.error("Could not open target database.");
};
};
document.body.appendChild(picker);
picker.click(); // Trigger the file select window
document.body.removeChild(picker);
})();
/
/
/
And then select the file you downloaded. Once done refresh your browser with (F5) and you should be able to load.
Hope this helps! And hopefully it’s formatted properly