google_http_warning2

Google検索結果でhttpは警告色で目立つようにする。(新デザイン用2023.3.5)

  1. // ==UserScript==
  2. // @name google_http_warning2
  3. // @namespace https://catherine.v0cyc1pp.com/
  4. // @match https://www.google.co.jp/search?*
  5. // @match https://www.google.com/search?*
  6. // @author greg10
  7. // @run-at document-end
  8. // @license GPL 3.0
  9. // @version 0.8
  10. // @grant none
  11. // @description Google検索結果でhttpは警告色で目立つようにする。(新デザイン用2023.3.5)
  12. // ==/UserScript==
  13.  
  14. console.log("google_http_warning2 start");
  15.  
  16.  
  17. function sub() {
  18.  
  19. // URL行
  20. document.querySelectorAll("cite").forEach(function(elem) {
  21. var parent4 = elem.parentNode.parentNode.parentNode.parentNode;
  22. //console.log("parent4=" + parent4);
  23. if ( parent == null ) {
  24. return;
  25. }
  26.  
  27. var tagname = parent4.tagName;
  28. //console.log("tagname=" + tagname);
  29. if ( tagname != "A" ) {
  30. return;
  31. }
  32.  
  33. var href = parent4.href;
  34. if (href == "") return;
  35. var index = href.indexOf("https");
  36. if (index == 0) return;
  37. elem.style.color = "#cc6600";
  38. elem.style.backgroundColor = "#eeeeee";
  39.  
  40.  
  41. // 子のspanも色変える。2023.3.5
  42. elem.querySelectorAll("span").forEach(function(magospan) {
  43. magospan.style.color = "#cc6600";
  44. magospan.style.backgroundColor = "#eeeeee";
  45. });
  46.  
  47. });
  48.  
  49. }
  50.  
  51. function main() {
  52. sub();
  53. }
  54.  
  55.  
  56. main();
  57.  
  58.