Have you ever wanted to quickly get the URL of a web page you are viewing in Markdown format or HTML tag format?
You want to paste it into an Obsidian note
You are writing a blog or note article
You want to post a link neatly when posting on X
To streamline this task, I created and use a custom bookmarklet.
When you use this bookmarklet, it automatically converts the URL of the open web page into the following formats and copies it to the clipboard. All you have to do is paste it.
Markdown
HTML tags
URL only
Title + URL
How to use
Here, I will introduce how to use it on an iPhone (Safari) as an example.
Open a web page
Tap the address bar to display your favorites
Tap the registered bookmarklet
When you tap the bookmarklet, the conversion and copying are completed automatically.
All that is left is to paste it into Obsidian or elsewhere. You can insert a Markdown-formatted link in an instant.
Other bookmarklets can be used with the same procedure.
How to register a bookmarklet
Add any web page to your "Favorites"
Open the edit screen for the added favorite
Replace the URL field with the bookmarklet code
That's all you need to do to get ready.
Bookmarklet code
▼ Convert to Markdown format and copy
javascript:navigator.clipboard.writeText("["%20+%20document.title%20+%20"]("%20+%20document.URL%20+%20")").then(()=>alert("%E3%82%B3%E3%83%94%E3%83%BC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F")).catch(err=>alert("%E3%82%B3%E3%83%94%E3%83%BC%E3%81%AB%E5%A4%B1%E6%95%97%EF%BC%9A"%20+%20err));
▼ Convert to HTML tag and copy
javascript:(()=>navigator.clipboard.writeText(document.title%20+%20"\\n"%20+%20document.URL).then(()=>alert("%E3%82%B3%E3%83%94%E3%83%BC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F")).catch(e=>alert("%E3%82%B3%E3%83%94%E3%83%BC%E3%81%AB%E5%A4%B1%E6%95%97%EF%BC%9A"%20+%20e));)();
▼ Copy URL only
javascript:(async%20function()tryawait%20navigator.clipboard.writeText(document.URL);alert('%E3%82%B3%E3%83%94%E3%83%BC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%EF%BC%81');catch(err)alert('%E3%82%B3%E3%83%94%E3%83%BC%E3%81%AB%E5%A4%B1%E6%95%97%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82');)();
▼ Copy title + URL
javascript:(()=>navigator.clipboard.writeText(document.title%20+%20"\\n"%20+%20document.URL).then(()=>alert("%E3%82%B3%E3%83%94%E3%83%BC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F")).catch(e=>alert("%E3%82%B3%E3%83%94%E3%83%BC%E3%81%AB%E5%A4%B1%E6%95%97%EF%BC%9A"%20+%20e));)();
Conclusion
I use these four types of bookmarklets regularly, and they really make URL-related tasks comfortable.
It is especially convenient that they can also be used on iPhone.
They are a great fit for bloggers, Obsidian users, and those who write on note, so please give them a try.
That is all.
If this article was even a little helpful,
please give it a 'Like'.
Also, following me would be a great encouragement!
Related articles
If you think, "I want to try Kindle publishing!", please take a look. This is a magazine (free) containing know-how that can get you to publication even with zero knowledge.
If you want to know the relationship between Kindle publishing royalties and themes, this is recommended.
Also check out these Kindle books
▼New Releases
▼"Intellectual Production," "Input," "Output," and "Information Dissemination"
If these keywords resonate with you,
I have listed my books that you might enjoy.
Please take a look (free for Kindle Unlimited users).