Last active
January 2, 2023 04:09
-
-
Save rcyeh/fe1fe02c7f610bb5d9b797795f6976e9 to your computer and use it in GitHub Desktop.
Exporting images from https://canvas.apps.chrome/
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
// Javascript console script for exporting all images from https://canvas.apps.chrome/ on 2023-01-01 | |
const sleep = ms => new Promise(r => setTimeout(r, ms)); // https://stackoverflow.com/a/39914235 | |
const gi = document | |
.getElementById("drawing-app") | |
.shadowRoot | |
.getElementById("drawing-gallery") | |
.shadowRoot | |
.getElementById("main") | |
.getElementsByTagName("gallery-item"); | |
for (i = 0; i < gi.length; ++i) { | |
console.log(`exporting ${i}`); | |
var bb = gi[i].shadowRoot.getElementById("bottom-bar"); | |
bb.getElementsByTagName("ea-menu")[0] | |
.shadowRoot | |
.children[0] // mwc-menu | |
.children[0] // div#entries-container | |
.children[1] // div for the menu-export element; use 4 for delete | |
.children[0] // ea-menu-list-item | |
.children[0] // span | |
.click(); | |
await sleep(6000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment