您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Allow "Save image as..." on context menu of Instagram.
当前为
// ==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);