Navigate to a website, click the bookmarklet, enter your caption and recieve a text-file.
For example, let's say you visit example.com
and press the bookmarklet. You'll recieve a text file called Example.txt
containing the following:
[Example](http://example.com)
Your caption here
Make a new bookmark in your browser (right-click on the bookmarks bar and click Add Page...
)
- For the "Name" you might put "Save link".
- Copy the code block below, paste this into the "URL" or "Location" of the new bookmark.
javascript:(function () {
var caption = window.prompt("Would you like to add a caption?");
if (caption === null) return;
var textToSave = `[${document.title}](${window.location.href})\n\n${caption}`;
var textToSaveAsBlob = new Blob([textToSave], { type: "text/plain" });
var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);
var fileNameToSaveAs = document.title + ".txt";
var downloadLink = document.createElement("a");
downloadLink.download = fileNameToSaveAs;
downloadLink.innerHTML = "Download File";
downloadLink.href = textToSaveAsURL;
downloadLink.onclick = (e) => document.body.removeChild(e.target);
downloadLink.style.display = "none";
document.body.appendChild(downloadLink);
downloadLink.click();
})();