Skip to content

Instantly share code, notes, and snippets.

View harmakit's full-sized avatar
💾
Trapped in a floppy disk

Pavel Buev harmakit

💾
Trapped in a floppy disk
View GitHub Profile
@harmakit
harmakit / gist:dfb54d833e20e05c9aac9ef0241742e8
Created December 14, 2023 17:16
Obsidian Clipper Bookmarklet – Safari (both desktop and mobile)
0. Install "Obsidian Advanced URI" plugin and (optionally) "Local Images Plus" to save images from clipped pages locally
1. Create bookmark with from any url
2. Edit address to:
```
javascript:(function()%7B%2F*%20Optional%20vault%20name%20*%2F%0Aconst%20vault%20%3D%20%22%22%3B%0A%0A%2F*%20Optional%20folder%20name%20such%20as%20%22Clippings%2F%22%20*%2F%0Aconst%20folder%20%3D%20%22%2B%2F%D0%A1%D0%BE%D1%85%D1%80%D0%B0%D0%BD%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5%2F%22%3B%0A%0A%2F*%20Optional%20tags%20%20*%2F%0Alet%20tags%20%3D%20%22clippings%22%3B%0A%0A%0A%0A%2F*%0A%20*%0A%20*%20Embed%20turndown%406.0.0%20to%20work%20around%20content%20security%20policies%20breaking%20import%20statements%0A%20*%0A%20*%2F%0A%0Afunction%20extend%20(destination)%20%7B%0A%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20arguments.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20var%20source%20%3D%20arguments%5Bi%5D%3B%0A%20%20%20%20for%20(var%20key%20in%20source)%20%7B%0A%20%20%20%20%20%20if%20(source.hasOwnProperty(key))%20destination%5Bkey%5D%20%3D