Instagram Full Size Reloaded

View the fullsize Instagram image after clicking the preview photo. Plus: open video source from single page view.

当前为 2016-02-10 提交的版本,查看 最新版本

// ==UserScript==
// @name         Instagram Full Size Reloaded
// @namespace    http://despecial.de
// @homepage     https://greasyfork.org/en/scripts/14755-instagram-full-size-reloaded
// @version      1.6
// @description  View the fullsize Instagram image after clicking the preview photo. Plus: open video source from single page view.
// @author       despecial
// @match        *://*.instagram.com/*
// @grant        none
// ==/UserScript==

$(document).on('click','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',function(e){
    if(e.shiftKey) {
	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]+.[^\\/]*','[?+].+','[?+].+');	    
	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, '_blank'); }
       if(fs) window.open(fs, '_blank');
    }
});