This file contains hidden or 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
// 1. Save this to a bookmarklet with https://make-bookmarklets.com/ | |
// 2. Run bookmarklet | |
// 3. Find the canvas in developer tool and "use it in console" | |
// 4. Run `copyCanvas(temp0)` | |
// 5. Click anywhere on the webpage (to workaround the restriction that | |
// clipboard writes must be triggered some user interaction) | |
window.copyCanvas = canvas => ( | |
canvas.toBlob(blob => ( | |
window.addEventListener("click", () => ( | |
navigator.clipboard.write([ |
This file contains hidden or 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
function setFeedMaxEntries(count = Number.MAX_SAFE_INTEGER) { | |
let f = chrome.extension.getBackgroundPage().feedbrobg | |
f.getSettings().setFeedMaxEntries(count) | |
f.saveSettings() | |
} | |
setFeedMaxEntries(Number.MAX_SAFE_INTEGER) |
This file contains hidden or 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
import fs from "fs/promises"; | |
const file = await fs.readFile("metadata.json", { encoding: "utf-8" }); | |
/** @type {{ [key: string]: { source: string } }} */ | |
const metadata = JSON.parse(file); | |
/** @type {{ [key: string]: number }} */ | |
const authors = {}; | |
Object.values(metadata).forEach((data) => { |
This file contains hidden or 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
// fig: the <figure> element to download | |
// could be easily used in batch download | |
// requires CORS errors to be disabled | |
const dlPhoto = async (fig) => { | |
const img = fig.querySelector('u > a').href | |
const res = await (await fetch(img)).text() | |
const doc = new DOMParser().parseFromString(res, 'text/html') | |
const photo = doc.querySelector('#submissionImg').src | |
const blob = await (await fetch(photo)).blob() | |
const a = document.createElement('a') |