instagram_allow_saveimage

Allow "Save image as..." on context menu of Instagram.

Stan na 01-07-2017. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        instagram_allow_saveimage
// @namespace   http://catherine.v0cyc1pp.com/instagram_allow_saveimage.user.js
// @include     https://www.instagram.com/*
// @version     1.10
// @require     http://code.jquery.com/jquery-2.2.4.min.js
// @grant       none
// @run-at      document-end
// @description Allow "Save image as..." on context menu of Instagram.
// @description KNOWN ISSUE: can't save videos.
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);


console.log("instagram_allow_saveimage start");


function main() {
	//$("div[is='null']").each(function() {
	$("div").each(function() {


		// Fix: The extension 'Chrome IG Story' is not showing.
		//var parentEls = $(this).parents("#rcr-anchor");
		var parentEls = $(this).parents("article");
		//console.log("parentEls="+parentEls);
		//console.log("parentEls.length="+parentEls.length);
		if ( parentEls !== null && parentEls.length === 0 ) {
			//console.log("Warning: this is the 'story'");
			return;
		}

		var classname = $(this).attr("class");


		var kids = $(this).children();
		console.log("len="+kids.length);
		if ( kids.length === 0 ) {

			var at = $(this).attr("style");
			if ( at !== null && at !== undefined && at !== "" ) {
				console.log("return, this is a style: classname="+classname);
				$(this).attr("display", "inline");
				return;
			}

			/*
			var button = $(this).parent("div").parent("button");
			if ( button === null || button === undefined ) {
				console.log("return, this is a button: classname="+classname);
				return;
			}
			*/

			console.log("hide: classname="+classname);
			$(this).hide();
		} else {
			console.log("show: classname="+classname);
			$(this).removeAttr("style");
		}
	});
	/*
	$("div > a").each(function() {
		var classname = $(this).parent().attr("class");
		console.log("parent classname="+classname);

		var attr = $(this).attr("videoSpritePlayButton");
		console.log("attr="+attr);
		if ( attr === null || attr === undefined || attr === "" ) {
			return;
		}

		console.log("hide: parent classname="+classname);
		$(this).parent().hide();


	});
	$("iframe").each(function() {
		$(this).parent().hide();
	});
	*/
}


var observer = new MutationObserver(function(mutations) {
    observer.disconnect();
    main();
    observer.observe( document, config);
});

var config = { attributes: false, childList: true, characterData: false, subtree:true };

observer.observe( document, config);