From 506d3cad255810487e5b0374215a95e6ff54dd04 Mon Sep 17 00:00:00 2001 From: Function <34871211+FunctionDJ@users.noreply.github.com> Date: Sat, 23 Jul 2022 23:35:40 +0200 Subject: [PATCH] Shorten and simplify example bookmarklet in documentation (#297) * Shorten and simplify example bookmarklet * Restore server placeholder in bookmarklet documentation --- docs/how-to.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/how-to.md b/docs/how-to.md index ac7eac6..2dbbb77 100644 --- a/docs/how-to.md +++ b/docs/how-to.md @@ -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:///bookmarks/new'; applicationUrl += '?url=' + encodeURIComponent(bookmarkUrl); applicationUrl += '&auto_close'; window.open(applicationUrl);})(); +javascript:window.open(`http:///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.