View Image Add for Google Search

Adding button which directing us to image to google

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name 				View Image Add for Google Search
// @description Adding button which directing us to image to google
// @author 			@Hozuki_Aoi edited to English
// @namespace 	https://twitter.com/Hozuki_Aoi
// @version 		1.1
// @include 		https://*.google.*/search?tbm=isch*
// @include 		https://*.google.*/search?*&tbm=isch*
// @grant				GM_openInTab
// @run-at			document-idle
// ==/UserScript==

(function() {
    'use strict';
    var element = document.querySelectorAll("._FKw td:nth-child(1)");
    var elementtimer = setInterval(function(){
        var element = document.querySelectorAll("._FKw td:nth-child(1)");
        if (element.length) {
            var newElement = document.createElement("td");
            var link = document.createElement("a");
            link.href = 'javascript:void function(){function isElementVisible(el){var rect=el.getBoundingClientRect(),vWidth=window.innerWidth||doc.documentElement.clientWidth,vHeight=window.innerHeight||doc.documentElement.clientHeight,efp=function(x,y){return document.elementFromPoint(x,y)};return rect.right<0||rect.bottom<0||rect.left>vWidth||rect.top>vHeight%3F!1:el.contains(efp(rect.left,rect.top))||el.contains(efp(rect.right,rect.top))||el.contains(efp(rect.right,rect.bottom))||el.contains(efp(rect.left,rect.bottom))}"undefined"==typeof window.isElementVisible;{var imgs=document.querySelectorAll(".irc_mi");imgs.forEach(function(img){isElementVisible(img)%26%26window.open(img.src)})}}();';
            var span = document.createElement("span");
            span.classList.add("_WKw");
            span.appendChild(document.createTextNode("View Image"));
            link.appendChild(span);
            newElement.appendChild(link);
            for (var i = 0; i < element.length;i++) {
                element[i].after(newElement.cloneNode(true));
            }
            clearInterval(elementtimer);
        }
    },100);
})();