Google検索結果でhttpは警告色で目立つようにする。(新デザイン用2020.1.15)
目前為
// ==UserScript==
// @name google_http_warning2
// @namespace https://catherine.v0cyc1pp.com/
// @include https://www.google.co.jp/search?*
// @include https://www.google.com/search?*
// @author greg10
// @run-at document-end
// @license GPL 3.0
// @version 0.6
// @grant none
// @description Google検索結果でhttpは警告色で目立つようにする。(新デザイン用2020.1.15)
// ==/UserScript==
console.log("google_http_warning2 start");
function sub() {
/*
// タイトル行
document.querySelectorAll(".r > a").forEach(function(elem) {
var href = elem.href;
if (href == "") return;
var index = href.indexOf("https");
if (index == 0) return;
elem.style.color = "#cc6600";
elem.style.backgroundColor = "#eeeeee";
});
*/
// URL行
document.querySelectorAll("cite").forEach(function(elem) {
var parent = elem.parentNode;
//console.log("parent=" + parent);
if ( parent == null ) {
return;
}
var parent_parent = parent.parentNode;
//console.log("parent_parent=" + parent_parent);
if ( parent_parent == null ) {
return;
}
var tagname = parent_parent.tagName;
//console.log("tagname=" + tagname);
if ( tagname != "A" ) {
return;
}
var href = parent_parent.href;
if (href == "") return;
var index = href.indexOf("https");
if (index == 0) return;
elem.style.color = "#cc6600";
elem.style.backgroundColor = "#eeeeee";
});
}
function main() {
sub();
}
main();