software-factory
MAmattpocock/skills336k近 7 天新增 5,004 个 star
Capture the current page or a DOM target as a PNG
Use this skill when the user wants a browser screenshot.
load helper
/mod/_core/skillset/ext/skills/screenshots/screenshots.jshtml2canvas for you/mod/_core/skillset/ext/skills/screenshots/screenshots.js and pass custom html2canvasOptionshelpers
await import("/mod/_core/skillset/ext/skills/screenshots/screenshots.js")takeScreenshot({ target?, filename?, type?, quality?, html2canvasOptions? }) -> { canvas, blob, width, height, type, filename }screenshotBase64(options) -> { base64, width, height, type, filename }screenshotDownload("name.png", options?) -> downloads and returns { downloaded: true, filename, width, height, type }target
target for a full-page document.body screenshottarget may be a CSS selector string or a DOM elementpage-content.pngguidance
screenshotDownload(...) when the user wants an actual image filescreenshotBase64(...) only when JavaScript needs inline image data, because the return value is largeexamples Taking a low-level screenshot result _____javascript const screenshots = await import("/mod/_core/skillset/ext/skills/screenshots/screenshots.js") return await screenshots.takeScreenshot()
Downloading a full-page screenshot _____javascript const screenshots = await import("/mod/_core/skillset/ext/skills/screenshots/screenshots.js") return await screenshots.screenshotDownload("page-content.png")
Capturing a specific panel _____javascript const screenshots = await import("/mod/_core/skillset/ext/skills/screenshots/screenshots.js") return await screenshots.screenshotDownload("panel.png", { target: "[data-panel]" })
Getting base64 image data _____javascript const screenshots = await import("/mod/_core/skillset/ext/skills/screenshots/screenshots.js") return await screenshots.screenshotBase64()
MAmattpocock/skills336k近 7 天新增 5,004 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
AFaffaan-m/ECC314k近 7 天新增 4,125 个 star
AFaffaan-m/ECC314k近 7 天新增 4,125 个 star
AFaffaan-m/ECC314k近 7 天新增 4,125 个 star
DIDietrichGebert/ponytail202k近 7 天新增 4,780 个 star