您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add Watched indicator to show48.com
当前为
// ==UserScript== // @name Show48 Local Watched Indicator // @namespace http://sk3dsu-phantasy.com/ // @version 0.1 // @description Add Watched indicator to show48.com // @author sk3dsu (Fadli) // @match *://*.show48.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // ==/UserScript== function GM_main ($) { var urlPath = window.location.pathname; console.log(urlPath); if( $('#video-toolbar').length ) { console.log("video-toolbar exist"); urlPath = urlPath.slice(1); urlPath = urlPath.slice(0, -1); console.log(urlPath); var theValue = GM_getValue(urlPath, 0); console.log('theValue: ' + theValue); if ($(".video-toolbar-item-like-bar")[0]) { var newDiv = document.createElement("div"); newDiv.className = "like-dislike pull-left"; var span = document.createElement("span"); span.id = "pawWatch"; span.innerHTML = "<i class='fa fa-paw'></i> Watched"; if (theValue == 1) { span.style.color = "green"; } var input = document.createElement("input"); input.id = "isWatched"; input.value = theValue; input.type = "hidden"; newDiv.appendChild(span); var parentDiv = document.getElementsByClassName("video-toolbar-item-like-bar")[0]; var currentDiv = parentDiv.children[0]; currentDiv.appendChild (newDiv); newDiv.addEventListener("click", function(){ if (input.value == 1) { input.value = 0; span.style.color = ""; GM_deleteValue(urlPath); } else { input.value = 1; span.style.color = "green"; GM_setValue(urlPath, 1); } }); } } else { console.log("video-toolbar NOT exist"); } } if (typeof jQuery === "function") { console.log ("Running with local copy of jQuery!"); GM_main (jQuery); } else { console.log ("fetching jQuery from some 3rd-party server."); add_jQuery (GM_main, "1.11.2"); } function add_jQuery (callbackFn, jqVersion) { var jqVersion = jqVersion || "1.11.2"; var D = document; var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement; var scriptNode = D.createElement ('script'); scriptNode.src = 'http://ajax.googleapis.com/ajax/libs/jquery/' + jqVersion + '/jquery.min.js' ; scriptNode.addEventListener ("load", function () { var scriptNode = D.createElement ("script"); scriptNode.textContent = 'var gm_jQuery = jQuery.noConflict (true);\n' + '(' + callbackFn.toString () + ')(gm_jQuery);' ; targ.appendChild (scriptNode); }, false); targ.appendChild (scriptNode); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址