<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Asad Ali (Asdi)</title>
    <description>The latest articles on DEV Community by Asad Ali (Asdi) (@asad_aliasdi_c88b14517).</description>
    <link>https://dev.to/asad_aliasdi_c88b14517</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4248282%2F607ccdfa-6090-4641-a47f-9e413a5bb7ed.jpg</url>
      <title>DEV Community: Asad Ali (Asdi)</title>
      <link>https://dev.to/asad_aliasdi_c88b14517</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asad_aliasdi_c88b14517"/>
    <language>en</language>
    <item>
      <title>A one-line bookmarklet that sends any video page to a downloader</title>
      <dc:creator>Asad Ali (Asdi)</dc:creator>
      <pubDate>Mon, 16 Nov 2026 18:03:57 +0000</pubDate>
      <link>https://dev.to/asad_aliasdi_c88b14517/a-one-line-bookmarklet-that-sends-any-video-page-to-a-downloader-31ei</link>
      <guid>https://dev.to/asad_aliasdi_c88b14517/a-one-line-bookmarklet-that-sends-any-video-page-to-a-downloader-31ei</guid>
      <description>&lt;p&gt;I build &lt;a href="https://pullclipvid.com/" rel="noopener noreferrer"&gt;PullClip&lt;/a&gt;, a free browser-based video downloader, and the feature people ask about most is the smallest one: a bookmarklet. You click it on a video page and the same video opens in the downloader, ready to save.&lt;/p&gt;

&lt;p&gt;Here is the whole thing, how each part works, and why bookmarklets are still worth knowing in 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;javascript&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'https://pullclipvid.com/?url='&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nf"&gt;encodeURIComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the entire feature. One line.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;javascript:&lt;/code&gt;&lt;/strong&gt; tells the browser to run the bookmark as code instead of opening it as a web address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;(function(){ ... })()&lt;/code&gt;&lt;/strong&gt; is an IIFE (immediately invoked function expression). It keeps any variables out of the page's global scope, so the bookmarklet never clashes with the site's own scripts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;location.href&lt;/code&gt;&lt;/strong&gt; (on the right) reads the address of the page you are on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;encodeURIComponent()&lt;/code&gt;&lt;/strong&gt; is the part people skip and then wonder why it breaks. Video links are full of &lt;code&gt;?&lt;/code&gt;, &lt;code&gt;&amp;amp;&lt;/code&gt; and &lt;code&gt;=&lt;/code&gt;. Without encoding, &lt;code&gt;https://site.com/watch?v=abc&amp;amp;t=30&lt;/code&gt; would split the query string, and the downloader would only receive half the link.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;location.href = ...&lt;/code&gt;&lt;/strong&gt; (on the left) navigates to the downloader with the encoded link in &lt;code&gt;?url=&lt;/code&gt;, and the page fills the input box for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why a bookmarklet and not an extension?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No install and no store review&lt;/li&gt;
&lt;li&gt;No permissions: it reads nothing on the page except its address&lt;/li&gt;
&lt;li&gt;Works in Chrome, Firefox, Edge and Safari on desktop&lt;/li&gt;
&lt;li&gt;Easy to audit: you can read every character of it above&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trade-off is that bookmarklets don't work well on mobile browsers, where bookmarks bars are hidden. For phones, PullClip uses the system Share menu instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Show your bookmarks bar (Ctrl+Shift+B on Windows and Linux, Cmd+Shift+B on Mac).&lt;/li&gt;
&lt;li&gt;Right-click the bar and add a new bookmark. Name it &lt;strong&gt;PullClip it&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Paste the code above as the URL and save.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Make your own
&lt;/h2&gt;

&lt;p&gt;The pattern works for any web tool that accepts a link in the query string. Swap the base URL and you have a bookmarklet for an archiver, a translator, a QR code generator or a link checker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;javascript&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'https://example.com/?url='&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nf"&gt;encodeURIComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you would rather keep the current tab, use &lt;code&gt;window.open(...)&lt;/code&gt; instead of assigning &lt;code&gt;location.href&lt;/code&gt;, so the tool opens in a new tab.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Code and install steps on GitHub: &lt;a href="https://github.com/shahroz-su/pullclip-bookmarklet" rel="noopener noreferrer"&gt;shahroz-su/pullclip-bookmarklet&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PullClip works with public videos from 28 sites, including YouTube, TikTok, Instagram, VK and OK.ru: &lt;a href="https://pullclipvid.com/" rel="noopener noreferrer"&gt;pullclipvid.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What small bookmarklets do you still use every day? I'd like to hear about them in the comments.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
