google_plus_image_address_finder

try to find out the download url of a google plus image

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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_plus_image_address_finder
// @namespace    NULL
// @version      0.1
// @description  try to find out the download url of a google plus image
// @author       Simon Shi
// @match        https://plus.google.com/photos/photo/*
// @grant        unsafeWindow
// @run-at       context-menu
// ==/UserScript==


function get_image()
{
    var image_list = [];

    image_list = unsafeWindow.document.getElementsByClassName("XkWAb-LmsqOc XkWAb-Iak2Lc");
    if(image_list.length === 0){
        console.log("[LS]no image found!!!");
        return 0;
    }
    var image_src = image_list[image_list.length-1].src;
    console.log("[LS]image src = "+image_src);
    var temp_a=document.createElement('a');
    document.body.appendChild(temp_a);
    temp_a.href=image_src.split("=")[0] + "=s0-d-ip";
    temp_a.click();
    document.removeChild(temp_a);
}


(function() {
    'use strict';

    console.log("[LS]Google Plus Image address finder :start");
    get_image();
})();