您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Sets the title attribute on the RES Image in a Reddit thread to match the document title. This is done so extensions like Pinterest can capture the image and use the document's title as the description.
当前为
- // ==UserScript==
- // @name Modify RES Image Title
- // @namespace http://tampermonkey.net/
- // @version 1.1
- // @description Sets the title attribute on the RES Image in a Reddit thread to match the document title. This is done so extensions like Pinterest can capture the image and use the document's title as the description.
- // @author PoorPolonius
- // @include http://www.reddit.com/r/*
- // @include https://www.reddit.com/r/*
- // @match http://www.reddit.com/r/*
- // @match https://www.reddit.com/r/*
- // @grant GM_log
- // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
- // @license Copyright 2015 reddit.com/u/PoorPolonius; Released under the MIT license
- // ==/UserScript==
- /* jshint -W097 */
- 'use strict';
- // Your code here...
- $(document).ready(function () {
- var siteTable = "#siteTable",
- toggleButton = "a[class*='toggleImage']",
- resImage = "img[class*='RESImage']";
- var toggleHandler = function (_evt) {
- $(resImage).attr("title", document.title);
- $(siteTable).undelegate(toggleButton, "click");
- };
- $(siteTable).delegate(toggleButton, "click", toggleHandler);
- });