EDIT: The official Obsidian Web Clipper is now available and can be downloaded for all major browsers:
My Web Clipper bookmarklet is an alternative to the MarkDownload Extension. It uses a bookmark to create a new file in Obsidian. Bookmarklets work across browsers and can sync across devices if you sync your bookmarks.
This bookmarklet supports both clipping the entire page, or just a selection. Here’s a 90 second demo of how it works:
You can find the code on Gist. To install the Web Clipper copy the code into the URL field of a bookmark.
Note: If you don’t clip a selection but the whole page, it uses the browser’s “Reading View” which might cut out some images and even the whole text if it is rather short (i.e. short poems, quotes, etc.).
In that case, @kepano told me to use a selcetion instead, or just Ctrl+A to mark the whole page and cut the rest off in Obsidian.
Not working on …
Chromebook
92.0.4515.130 (Official Build) (64-bit)
Android Obsidian Mobile 1.0.3
/////// Working on Android phone when clipping entire page
I have now tested your bookmarklet on my Android phone & getting the whole page is working fine - apologies, I really should have tested that before commenting. Selection clipping not working as …
… when I go to the omnibox to select the bookmarklet from the dropdown(there is no bookmarks bar) the selection I made gets unselected and I wind up with the whole page.
Try looking in the developer console to see if any errors pop up when you trigger the bookmarklet.
The bookmarklet is definitely designed for people with a bit more programming experience. You can always try the MarkDownload extension as an alternative.
It seems that Vivaldi is complaining because the bookmarklet is accessing JS packages from the web (the unpkg.com links). You could try to include the code from those JS packages into the bookmarklet itself to prevent those calls, or try other Obsidian bookmarklets that don’t rely at all on external resources — however those don’t handle formatting AFAIK.
This gives an error on Linux Ubuntu Chrome:
22068:1 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://unpkg.com/[email protected]?module
Added optional variables for vault name, folder name and tags
Added detection and removal of illegal characters for Windows file names
Cleaned up the code to make it easier to edit the file template
Note that this bookmarklet may not work for all websites and browsers. Take a look at MarkDownload extension and Send to Obsidian for alternatives that may work better for your setup.
We’re working on the boundaries here anyway: Older browsers don’t know how to, newer ones like Vivaldi simply reject for security reasons, the dynamic loading of modules in bookmarklets.
Still a very creative idea, and well done, for browsers that allow this.
(Once the browser devs learn what we do here, they’ll probably stitch this potential security hole very fast …)
Yes, it would be easy to bake those modules in, but I wanted to keep the code relatively readable and editable for those who want to edit it. I haven’t run into many sites that block it so far.
Isn’t there, though, a limit on bookmarklet length which would make it difficult to bake those modules in? I know I ran into this with a bookmarklet to tag and save stuff to pinboard and had to rewrite it as an extension (which brings its own problems on mobile)
Hello! this is awesome! Is it possible to highlight the content, keep it on the clipboard and have jt paste it all to obsidian?
Something like this Bento - streamlined workflow for taking notes whi…: https://youtu.be/9CKbMDmf-Rw