# A simple bookmarklet to share the current page > Learn how to create a one-click bookmarklet that instantly shares the current webpage to Twitter or Bluesky. **Tags:** engineering, project, tools, development **Date:** 2025-01-25T00:15:22.000Z --- In 2019, Christian Heilmann introduced a brilliant little bookmarklet on [DEV Community](https://dev.to/codepo8/a-simple-bookmarklet-to-tweet-the-current-page-1mlk) — a tool designed to make sharing the webpage you’re viewing on Twitter as simple as a single click. But as technology evolves, so do platforms. Twitter’s changes to its tweet creation process rendered the original bookmarklet obsolete. I've updated Christian's code to fix this issue, so now the bookmarklet works again. You can check out the updated code below or on this [bookmarklet-tweet-current-page.js Gist](https://gist.github.com/schalkburger/cfb8de525ccc37615921746d5093fd24). ## Tweet current page bookmarklet ```js javascript:(function(){n=getSelection().anchorNode;if(!n){t=document.title;}else{t=n.nodeType===3?n.data:n.innerText;}t=%27“%27+t.trim()+%27”\n\n%27;window.open(`https://twitter.com/compose/tweet?text=${encodeURIComponent(t)}${document.location.href}`)})(); ``` ## Share on Bluesky bookmarklet I’ve also created an equivalent bookmarklet for Bluesky, giving you the same one-click convenience to share pages on this rising platform. The code for this is below or on this [bookmarklet-share-bluesky.js Gist](https://gist.github.com/schalkburger/4d8ed2f1020acbe2a537ccb62a425f3a). ```js javascript:(function(){n=getSelection().anchorNode;if(!n){t=document.title;}else{t=n.nodeType===3?n.data:n.innerText;}t=%27“%27+t.trim()+%27”\n\n%27;window.open(`https://bsky.app/intent/compose?text=${encodeURIComponent(t)}${document.location.href}`)})(); ``` ## How to create a bookmarklet Creating the bookmarklet is surprisingly easy. Here’s how to do it: ### 1. Open Your Browser’s Bookmark Manager In most browsers, you can do this by right-clicking the bookmarks bar and selecting “Add page” or “New bookmark.” ### 2. Add a New Bookmark Give it a name like “Share on Twitter” or “Share on Bluesky” ### 3. Paste the JavaScript Code Paste the JavaScript code from one of the examples above. ### 4. Save the Bookmarklet Click “Save” or “Done,” and you’re all set! ## How to use Once you've made the bookmarklet, simply click the bookmarklet in your bookmarks bar, and the current page you are on will be shared in a new tab.