google_http_warning2

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

目前為 2022-05-12 提交的版本,檢視 最新版本

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

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址