Last active
April 10, 2024 13:33
-
-
Save eai04191/e896a5da0b968db69b59e77c7bd3a7b5 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name GM_download test | |
// @author Eai <[email protected]> | |
// @license MIT | |
// @version 1.0.0 | |
// @match https://example.com/ | |
// @grant GM_registerMenuCommand | |
// @grant GM_download | |
// ==/UserScript== | |
/* global GM_registerMenuCommand */ | |
/* global GM_download */ | |
function main() { | |
const sampleBlob = new Blob(["Hello, world!"], { type: "text/plain" }); | |
const url = window.URL.createObjectURL(sampleBlob); | |
GM_download(url, "hello.txt"); | |
} | |
(() => { | |
GM_registerMenuCommand("Download", main); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment