-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Labels
good first issue 👍Good for newcomersGood for newcomers🔥 enhancementNew feature or requestNew feature or request
Description
/download-images
command in the search bar runs the following plugin script
const run = async () => {
const dirHandle = await window.showDirectoryPicker();
const imgs = document.querySelectorAll("img");
let i = 0;
imgs.forEach(async (img) => {
const url = img.src;
const name = `img-${i}.png`;
i++;
try {
console.log(`Fetching ${url}`);
const response = await fetch(url);
console.log(`Saving to ${name}`);
const file = await dirHandle.getFileHandle(name, { create: true });
const writable = await file.createWritable();
await response.body.pipeTo(writable);
} catch (err) {
console.log(err);
}
});
};
run();
https://paul.kinlan.me/bookmarklet-to-download-all-images-on-a-page-with-the-file-system-api/
Metadata
Metadata
Labels
good first issue 👍Good for newcomersGood for newcomers🔥 enhancementNew feature or requestNew feature or request