Mastodon 特定の絵文字が入った名前の人を非表示
by
pacochi
2017-04-26 [2017/04/26 22:33:14]
http://let.hatelabo.jp/pacochi/let/hLHW8svRzY8o をお使いください。
-
/*
* @title Mastodon 特定の絵文字が入った名前の人を非表示
* @description http://let.hatelabo.jp/pacochi/let/hLHW8svRzY8o をお使いください。
* @include *
* @license MIT License
* @javascript_url
* @private
*/
/*
このブックマークレットの更新は停止しました。
以後は同様の動作が可能になる以下のものをお使いください。
Mastodon 連合 or ローカルタイムライン用正規表現フィルタ
http://let.hatelabo.jp/pacochi/let/hLHW8svRzY8o
*/
((d = document, o, x, i, l, c) => {
o = new MutationObserver(s => s.forEach(t => {
x = d.evaluate(
// 「 or img/@alt="絵文字"」を追加していくと増やせる
'.//div[@class="status"][div/a/span/strong[img/@alt="?" or img/@alt="?"]]',
t.target, null, 6, x);
for (i = 0; i < x.snapshotLength; i++) x.snapshotItem(i).style.display = 'none';
}));
l = $('.columns-area');
c = $('#mute-buttons');
if (!c[0]) c = $('<div />')
.css({ position: 'fixed', height: '1em', bottom: '2em', right: 0, zIndex: 99 })
.attr('id', 'mute-buttons').prependTo(l);
c.append(
$('<button />').text('?')
.click(function (e, b) {
b = $(this);
if (b.text() == '?') {
b.text('?');
o.observe(l.get(0), {
childList: 1,
subtree: 1
});
} else {
b.text('?');
o.disconnect();
$('.status').filter(":hidden").show();
}
}).click()
);
})();
-
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。