羊をはてなアイコン化@はてなパークス
by
Knoa
6 hours ago [2026/08/22 16:19:22]
https://anond.hatelabo.jp/20260822121613
@@ -9,4 +9,5 @@
const SOURCE = 'https://cdn.profile-image.st-hatena.com/users/{id}/profile.png';
document.querySelectorAll('button > img[src*="/avatar_"][alt]').forEach(img => img.src = SOURCE.replace('{id}', img.alt));
document.querySelectorAll('a[href^="/user/"] > img[src*="/avatar_"][src*="_photo_"]').forEach(img => img.src = SOURCE.replace('{id}', img.parentNode.href.split('/user/')[1]));
-})();
+ document.querySelectorAll('img[src*="/avatar_"]:has(+ [class^="_bylineName_"])').forEach(img => img.src = SOURCE.replace('{id}', img.nextSibling.textContent.split(':')[1]));
+})();
/*
* @title 羊をはてなアイコン化@はてなパークス
* @description https://anond.hatelabo.jp/20260822121613
* @include https://p.hatena.ne.jp/*
* @license MIT License
*/
(function(){
const SOURCE = 'https://cdn.profile-image.st-hatena.com/users/{id}/profile.png';
document.querySelectorAll('button > img[src*="/avatar_"][alt]').forEach(img => img.src = SOURCE.replace('{id}', img.alt));
document.querySelectorAll('a[href^="/user/"] > img[src*="/avatar_"][src*="_photo_"]').forEach(img => img.src = SOURCE.replace('{id}', img.parentNode.href.split('/user/')[1]));
document.querySelectorAll('img[src*="/avatar_"]:has(+ [class^="_bylineName_"])').forEach(img => img.src = SOURCE.replace('{id}', img.nextSibling.textContent.split(':')[1]));
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。