Instagram Full Size Reloaded

View & download the fullsize Instagram image or video. Simple to use: shift-click on preview photo or press alt+f on single photo/video pages.

目前為 2016-02-28 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Instagram Full Size Reloaded
// @namespace    http://despecial.de
// @homepage     https://greasyfork.org/en/scripts/14755-instagram-full-size-reloaded
// @version      1.75
// @description  View & download the fullsize Instagram image or video. Simple to use: shift-click on preview photo or press alt+f on single photo/video pages.
// @author       despecial
// @match        *://*.instagram.com/*
// @grant        none
// ==/UserScript==

var ig = 'a[data-reactid^=".0.1.0.1"], div[data-reactid^=".0.1.0.0.0"]:eq(1), div[data-reactid^=".0.1.0.1.0."]:not(.ResponsiveBlock):nth-of-type(1), div[data-reactid^=".1.1.0.0.1."]:not(.ResponsiveBlock) div'; var map = [];

/* click preview photo/video */
$(document).on('click',ig,function(e,a){
    if(e.shiftKey || e.altKey || a == "rm") {
	var fs = $(this).find('img').attr('src'),
	     v = $(this).find('video').attr('src'),
	 rplcd = new Array('\/sh0.08','(\/[s|p][\\d]+x[\\d]+)','\/c[\\d]+\\.[\\d]+.[^\\/]*','[?+].+','[?+].+'),
	     t = (e.altKey) ? '_self' : '_blank';    
	for (var i = 0; i < rplcd.length; ++i) {
	  var r = new RegExp(rplcd[i],'i');
	  if( r.test(fs) ) fs=fs.replace(r,'');
	}
    if(v) { e.preventDefault(); window.open(v, t); }
    if(fs) window.open(fs, t);
    }
});

/* keyboard shortcut alt+f(ullsize) */
onkeydown = onkeyup = function(e){
    e = e || event;
    map[e.keyCode] = e.type == 'keydown';
    if(map[18] && map[70]) $('div[data-reactid^=".0.1.0.0.0"]:eq(1)').trigger('click',['rm']);
}