Skip to content

Feature Request: Bookmarklet #1

Description

@Gex2501

Thanks for making this. It works great! One thing though. I think it would be better, or just nicer, if there was an option for it to work similar to the javascript bookmarklet. Here's what I've been using for a long time but I hate having it in my bookmarks bar with no icon. Wouldn't need an API key, just the server address.

Actual bookmarklet

javascript:%20(function%20()%20%7B%20%20const%20bookmarkUrl%20=%20window.location;%20%20const%20title%20=%20%20%20%20document.querySelector('title')?.textContent%20%7C%7C%20%20%20%20document%20%20%20%20%20%20.querySelector(%60meta%5Bproperty='og:title'%5D%60)%20%20%20%20%20%20?.getAttribute('content')%20%7C%7C%20%20%20%20'';%20%20const%20description%20=%20%20%20%20document%20%20%20%20%20%20.querySelector(%60meta%5Bname='description'%5D%60)%20%20%20%20%20%20?.getAttribute('content')%20%7C%7C%20%20%20%20document%20%20%20%20%20%20.querySelector(%60meta%5Bproperty='og:description'%5D%60)%20%20%20%20%20%20?.getAttribute(%60content%60)%20%7C%7C%20%20%20%20'';%20%20let%20applicationUrl%20=%20'http://SERVER.LOCAL:9090/bookmarks/new';%20%20applicationUrl%20+=%20'?url='%20+%20encodeURIComponent(bookmarkUrl);%20%20applicationUrl%20+=%20'&title='%20+%20encodeURIComponent(title);%20%20applicationUrl%20+=%20'&description='%20+%20encodeURIComponent(description);%20%20applicationUrl%20+=%20'&auto_close';%20%20window.open(applicationUrl);%7D)();

Pretty formatted.

javascript:(function () {
    const bookmarkUrl = window.location;

    const title =
        document.querySelector("title")?.textContent ||
        document
            .querySelector("meta[property='og:title']")
            ?.getAttribute("content") ||
        "";

    const description =
        document
            .querySelector("meta[name='description']")
            ?.getAttribute("content") ||
        document
            .querySelector("meta[property='og:description']")
            ?.getAttribute("content") ||
        "";

    let applicationUrl =
        "http://SERVER.LOCAL:9090/bookmarks/new";

    applicationUrl += "?url=" + encodeURIComponent(bookmarkUrl);
    applicationUrl += "&title=" + encodeURIComponent(title);
    applicationUrl += "&description=" + encodeURIComponent(description);
    applicationUrl += "&auto_close";

    window.open(applicationUrl);
})();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions