Greasy Fork is available in English.

Notification Filter

一時的に通知を返信のみ見たいけど消したくは無いとき

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
  1. // ==UserScript==
  2. // @name Notification Filter
  3. // @namespace http://github.com/yuzulabo
  4. // @version 1.1.2
  5. // @description 一時的に通知を返信のみ見たいけど消したくは無いとき
  6. // @author nzws / ねじわさ
  7. // @match https://knzk.me/*
  8. // @match https://mastodon.cloud/*
  9. // @match https://friends.nico/*
  10. // @match https://pawoo.net/*
  11. // @match https://itabashi.0j0.jp/*
  12. // @license MIT License
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. window.onload = function () {
  17. var style = document.createElement("style");
  18. style.id = "notifilter-js";
  19. document.querySelector("head").appendChild(style);
  20.  
  21. style = document.createElement("style");
  22. style.innerHTML = "#notifilter{background: #313543;border: 0;color: #9baec8;font-size: 16px;}.notiactive{color:#fff !important;}";
  23. document.querySelector("head").appendChild(style);
  24.  
  25. window.isFilter = false;
  26.  
  27. var button_b = document.querySelector(".column button .fa-bell").offsetParent.children[1];
  28. var button = document.createElement("button");
  29. button.id = "notifilter";
  30. button.innerHTML = "<i class='fa fa-comment'></i>";
  31. button_b.insertBefore(button, button_b.firstChild);
  32.  
  33. button.addEventListener('click', filter);
  34. };
  35.  
  36. function filter() {
  37. window.isFilter = !window.isFilter;
  38. document.getElementById('notifilter-js').innerHTML = window.isFilter ? '.notification{display:none;}' : '';
  39. document.getElementById('notifilter').className = window.isFilter ? 'notiactive' : '';
  40. }
  41. })();