<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Bookmarklet on Ken Huang</title>
    <link>https://blog.kenhuang.io/tags/bookmarklet/</link>
    <description>Recent content in Bookmarklet on Ken Huang</description>
    <generator>Hugo</generator>
    <language>en</language>
    <managingEditor>kenhuang512@gmail.com (Ken Huang)</managingEditor>
    <webMaster>kenhuang512@gmail.com (Ken Huang)</webMaster>
    <lastBuildDate>Wed, 26 Feb 2025 00:32:16 +0800</lastBuildDate>
    <atom:link href="https://blog.kenhuang.io/tags/bookmarklet/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A Bookmarklet for Copying a Link as an Org-mode Link</title>
      <link>https://blog.kenhuang.io/blog/2022-08-08-org-link-bookmarklet/</link>
      <pubDate>Mon, 08 Aug 2022 23:33:05 +0800</pubDate><author>kenhuang512@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-08-08-org-link-bookmarklet/</guid>
      <description>&lt;p&gt;&#xA;In this blog post, I&amp;#39;d like to share a &lt;a href=&#34;https://en.wikipedia.org/wiki/Bookmarklet&#34;&gt;bookmarklet&lt;/a&gt; for copying a web page&amp;#39;s URL as an org-mode link on Firefox, Chrome, or whatever web browsers support bookmarklets.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;It&amp;#39;s handy when the URL isn&amp;#39;t SEO-friendly, which means you can&amp;#39;t tell what its content is about at first glance of the URL. So a little description text on the link would help.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Here is the bookmarklet:&lt;/p&gt;&#xA;&lt;div class=&#34;src src-js&#34;&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;javascript&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;prompt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Copy to clipboard: Ctrl+C, Esc&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;[[&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;href&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;][&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;title&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; - &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;]]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// Don&amp;#39;t know why the page becomes blank after using it on Firefox, so use alert instead.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;javascript&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;alert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;[[&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;href&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;][&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;title&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; - &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;]]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&#xA;Add a new bookmark on the browser, give it a name, such as &lt;code&gt;(org-link)&lt;/code&gt;, and then copy and paste the content as URL, just like below on Firefox:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Change Web Page Titles Easily</title>
      <link>https://blog.kenhuang.io/blog/2019-08-18-how-to-rename-web-page-titles-in-a-lightweight-way/</link>
      <pubDate>Sun, 18 Aug 2019 14:57:00 +0800</pubDate><author>kenhuang512@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2019-08-18-how-to-rename-web-page-titles-in-a-lightweight-way/</guid>
      <description>&lt;p&gt;&#xA;There are times that I need to open many web pages of some specific websites within a browser, and there are so many tabs that I can&amp;#39;t efficiently access one of them, as their favicons are all the same.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;So I tried to find a way to rename their titles, preferably in a lightweight way, so that I can spot them quickly with my eyes.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;The first thought came into my mind was to find some browser extensions to do the job. It was easy to install one with no time. But I was not very happy with the experience. It seems that it keeps the rule of renaming titles based on the URL so that the title will always be renamed if I refreshing it, which is not what I want. I&amp;#39;d rather want to do it in an ad-hoc way.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
