Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions bookmarklets/copy-title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// タイトルをコピー
// 現在のページのタイトルをクリップボードにコピー
// 📝
// v1
// 2026-03-28

(function() {
try {
var titleElement = document.querySelector("title");
var title = titleElement ? titleElement.textContent.trim() : document.location.pathname;
navigator.clipboard.writeText(title).catch(function() {
alert('Failed to copy to clipboard');
});
} catch (error) {
alert('Error: ' + error.message);
}
})();
9 changes: 8 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ <h3 class="bookmarklet-title">Markdownリンクをコピー<span class="version-
<a href="javascript:(function()%20%7B%0A%20%20try%20%7B%0A%20%20%20%20var%20titleElement%20%3D%20document.querySelector(%22title%22)%3B%0A%20%20%20%20var%20title%20%3D%20titleElement%20%3F%20titleElement.textContent.trim()%20%3A%20document.location.pathname%3B%0A%20%20%20%20navigator.clipboard.writeText(%60%5B%24%7Btitle%7D%5D(%24%7Blocation.href%7D)%60).catch(function()%20%7B%0A%20%20%20%20%20%20alert(&#039;Failed%20to%20copy%20to%20clipboard&#039;)%3B%0A%20%20%20%20%7D)%3B%0A%20%20%7D%20catch%20(error)%20%7B%0A%20%20%20%20alert(&#039;Error%3A%20&#039;%20%2B%20error.message)%3B%0A%20%20%7D%0A%7D)()%3B" class="bookmarklet-link emoji-only" onclick="alert('このリンクをブックマークバーにドラッグしてください'); return false;">📋</a>
</div>

<div class="bookmarklet-card">
<h3 class="bookmarklet-title">タイトルをコピー<span class="version-badge">v1 (2026-03-28)</span></h3>
<p class="bookmarklet-description">現在のページのタイトルをクリップボードにコピー</p>
<a href="javascript:(function()%20%7B%0A%20%20try%20%7B%0A%20%20%20%20var%20titleElement%20%3D%20document.querySelector(%22title%22)%3B%0A%20%20%20%20var%20title%20%3D%20titleElement%20%3F%20titleElement.textContent.trim()%20%3A%20document.location.pathname%3B%0A%20%20%20%20navigator.clipboard.writeText(title).catch(function()%20%7B%0A%20%20%20%20%20%20alert(&#039;Failed%20to%20copy%20to%20clipboard&#039;)%3B%0A%20%20%20%20%7D)%3B%0A%20%20%7D%20catch%20(error)%20%7B%0A%20%20%20%20alert(&#039;Error%3A%20&#039;%20%2B%20error.message)%3B%0A%20%20%7D%0A%7D)()%3B" class="bookmarklet-link" onclick="alert('このリンクをブックマークバーにドラッグしてください'); return false;">📝 タイトルをコピー v1</a>
<a href="javascript:(function()%20%7B%0A%20%20try%20%7B%0A%20%20%20%20var%20titleElement%20%3D%20document.querySelector(%22title%22)%3B%0A%20%20%20%20var%20title%20%3D%20titleElement%20%3F%20titleElement.textContent.trim()%20%3A%20document.location.pathname%3B%0A%20%20%20%20navigator.clipboard.writeText(title).catch(function()%20%7B%0A%20%20%20%20%20%20alert(&#039;Failed%20to%20copy%20to%20clipboard&#039;)%3B%0A%20%20%20%20%7D)%3B%0A%20%20%7D%20catch%20(error)%20%7B%0A%20%20%20%20alert(&#039;Error%3A%20&#039;%20%2B%20error.message)%3B%0A%20%20%7D%0A%7D)()%3B" class="bookmarklet-link emoji-only" onclick="alert('このリンクをブックマークバーにドラッグしてください'); return false;">📝</a>
</div>

<div class="bookmarklet-card">
<h3 class="bookmarklet-title">JSON Viewer<span class="version-badge">v29 (2026-03-14)</span></h3>
<p class="bookmarklet-description">複雑にネストされたJSONデータをマークダウン形式で綺麗に表示するビューアー</p>
Expand All @@ -167,7 +174,7 @@ <h3 class="bookmarklet-title">翻訳補助<span class="version-badge">v1 (2026-0


<footer>
<p>Generated: 2026-03-21</p>
<p>Generated: 2026-03-28</p>
<p>© 2026 AMPM Bookmarklets</p>
<p><a href="https://github.com/ampcpmgp/ampm-bookmarklets" class="github-link" target="_blank" rel="noopener noreferrer">⭐ View on GitHub</a></p>
</footer>
Expand Down