Mobile Bookmarklet

You can quickly and easily add bookmarks to your AllTheBookmarks account from any mobile device. Since you can't use extensions on mobile, you can log in from your mobile device and visit this page.

Below is a code snippet that you can copy. Copy the code, then create a new bookmark on your mobile device as you would normally. Before saving the bookmark, change the name to something simple like "ATB Bookmarker" and paste this code as the url.

Once you have the bookmarklet saved, you can simply go to your mobile bookmarks while on a page and this snippet will grab the info you need and add it to you account.

Default privacy:
Ask for Description:
Include a default color:
{colorSelect}
Include a default folder:
{folderSelect}
                javascript:(function() {
                    const apiKey = "{BK_API_KEY}";
                    const apiUrl = "{BK_API_URL}";
                    const url = window.location.href;
                    const name = prompt("Enter a name for the bookmark:");
                    {BK_JS_NOTES}
                    {BK_JS_COLOR}
                    {BK_JS_PRIVACY}
                    {BK_JS_FOLDER}

                    if (!name) {
                        alert("Name is required.");
                        return;
                    }
                
                    fetch(apiUrl + 'api/bookmarks/create', {
                        method: 'POST',
                        headers: {
                            'Content-Type': 'application/json',
                            'Authorization': `Bearer ${apiKey}`
                        },
                        body: JSON.stringify({ name, url, notes, color, privacy, folder })
                    })
                    .then(response => {
                        if (response.ok) {
                            alert("Bookmark saved successfully!");
                        } else {
                            alert("Failed to save bookmark. Please check your API key.");
                        }
                    })
                    .catch(error => {
                        console.error(error);
                        alert("An unknown error occurred while saving the bookmark.");
                    });
                })();