Shorten and simplify example bookmarklet in documentation (#297)

* Shorten and simplify example bookmarklet

* Restore server placeholder in bookmarklet documentation
This commit is contained in:
Function
2022-07-23 23:35:40 +02:00
committed by GitHub
parent fdfafbbb0b
commit 506d3cad25

View File

@@ -13,7 +13,7 @@ Chrome on Android does not permit running bookmarklets in the same way you can o
Create a bookmark of your linkding deployment by clicking the star icon which you find in the three dots menu in the top right. Next you have to edit the bookmark. Edit the URL and replace it it with the bookmarklet code of your instance and give it an easy to type name like `bm` for bookmark or `ld` for linkding:
```
javascript: (function() { var bookmarkUrl = window.location; var applicationUrl = 'http://<YOUR_INSTANCE_HERE>/bookmarks/new'; applicationUrl += '?url=' + encodeURIComponent(bookmarkUrl); applicationUrl += '&auto_close'; window.open(applicationUrl);})();
javascript:window.open(`http://<YOUR_INSTANCE_HERE>/bookmarks/new?url=${encodeURIComponent(window.location)}&auto_close`)
```
Now when you are browsing the web and you want to save the current page as a bookmark to your linkding instance simply type `bm` into the address bar and select it from the results. The bookmarklet code will trigger and you will be redirected so save the current page.