HMD.Link bookmarklet
Let’s make URL Sharing with hmd.link even easier!
Hello Coders! 👾 I’m super excited to let you in on a nifty trick that I’ve conjured. It’s all about sprinkling a little convenience on those devs who often find themselves juggling URLs across devices. Imagine a bookmarklet that tacks on “ https://hmd.link?" to the front of any URL, enabling swift sharing via hmd.link. Cool, right?
Bookmarklet? What’s That? 🤔
Let’s break it down. A bookmarklet is basically a ‘one-click’ wizardry tool saved as a URL bookmark in your web browser. But instead of whisking you away to a website, it performs an action using JavaScript when you give it a click.
My Magical Bookmarklet ✨
Here, let me show you the bookmarklet I whipped up:
javascript:(function()%7Bwindow.location.href%20%3D%20%22https%3A%2F%2Fhmd.link%3F%22%2Bwindow.location.href%7D)()
Under the Hood: How it Works 🛠️
This byte-sized code runs a petite JavaScript function when clicked. It snags the current webpage’s URL (window.location.href), then adds a dash of “ https://hmd.link?" to its beginning. The final result gives your browser’s location a fresh new URL.
Why hmd.link, You Ask? 🚀
HMD.link is an awesome tool for tossing URLs across devices. You can add links manually, but by sticking “ https://hmd.link?" in front of any URL, we can whip up shareable links in no time flat. So, whether you’re coding on your laptop and need to fling a URL to your mobile or vice versa, this bookmarklet can save you heaps of time!
Let’s Get Started: How to Use 🏁
To get this bookmarklet working for you:
- Create a shiny new bookmark in your browser.
- Copy and paste the above JavaScript code into the URL field.
- Click Save.
- Open any webpage and click on the newly created bookmark.
- And just like magic! You’re now redirected to an hmd.link version of your current page.
Or… Take the easy route and drag this to your favorites bar: HMD.Link
And there you have it! This tiny tool has been an absolute timesaver in my coding escapades—I hope you find it just as beneficial.
Happy Coding! 🚀