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 เพื่อติดตั้งสคริปต์นี้

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

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