Created
April 21, 2022 10:13
Download all custom backgrounds from google meet
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
const db = await new Promise((resolve, reject) => { | |
const request = window.indexedDB.open("meet_fx_db"); | |
request.onerror = event => { | |
reject("req fail"); | |
}; | |
request.onsuccess = event => { | |
resolve(event.target.result); | |
}; | |
}); | |
let i = 0; | |
db.transaction("meet_fx_store").objectStore("meet_fx_store").openCursor().onsuccess = event => { | |
const cursor = event.target.result; | |
if (!cursor) { | |
console.log("No more entries!"); | |
return; | |
} | |
console.log(`Processing key: ${cursor.key}`); | |
const { | |
data: { imageFileBlob, timestampMs }, | |
} = cursor.value; | |
// NOTE: delay to let chrome process files easily | |
setTimeout(() => { | |
const link = document.createElement("a"); | |
link.href = URL.createObjectURL(imageFileBlob); | |
link.download = `${timestampMs}.png`; | |
document.body.appendChild(link); | |
link.click(); | |
}, i++ * 500); | |
cursor.continue(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment