您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Re-add the "View Image" button to Google Images.
// ==UserScript== // @name Google View Image Button // @namespace http://tampermonkey.net/ // @version 0.1 // @description Re-add the "View Image" button to Google Images. // @author A guy that wants a simple button // @match https://www.google.co.uk/* // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js // ==/UserScript== (function() { 'use strict'; var decodedImgUrl = ""; $(window).click(function(e) { console.log(e.target.id + ' ' + e.target.src); var url = window.location.href.split("&");var url1; for (var i=0;i<url.length;i++) {url1 = url[i].split('#imgrc=');if (url1[0]==="tbm=isch") {console.log(url1[1]);}} var encodedimgurl = $('img[name='+url1[1]+']').parent().attr('href').split('?imgurl='); var encodedimgurl1 = encodedimgurl[1].split('&'); var decodedImgUrl = decodeURIComponent(encodedimgurl1[0]);console.log('decodedImgUrl = ' + decodedImgUrl); $('.removeThis').remove(); $('a[jsaction=r.7BN_2kPMxJo]').parent().parent().append('<td class="removeThis" id="'+decodedImgUrl+'"><a id="imageLinkURL" href="'+decodedImgUrl+'"><span>View image source</span></a></td>'); }); })();