Google View Image Button

Re-add the "View Image" button to Google Images.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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>');

    });

})();