SPM kbin enhancements

Few small changes to the kbin UI while they still develop some features

当前为 2023-06-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name SPM kbin enhancements
  3. // @description Few small changes to the kbin UI while they still develop some features
  4. // @namespace com.sirpsychomantis
  5. // @license MIT
  6. // @version 1.1
  7. // @grant none
  8. // @run-at document-end
  9. // @match https://fedia.io/*
  10. // @match https://kbin.social/*
  11. // ==/UserScript==
  12.  
  13.  
  14. (function(){
  15. function addDomain(link) {
  16. let parts = link.title.split("@");
  17. if (parts[2] !== location.hostname) {
  18. let linkText = link.childNodes[link.childNodes.length-1];
  19. linkText.nodeValue += "@" + parts[2];
  20. }
  21. }
  22. if (location.pathname.startsWith('/m')) {
  23. document.querySelectorAll(".magazine-inline, .user-inline").forEach(link => {
  24. addDomain(link);
  25. })
  26. } else {
  27. document.querySelectorAll(".magazine-inline").forEach(link => {
  28. addDomain(link);
  29. })
  30. }
  31. })();