Open Tweet Image

A shitty thrown together script to open a tweets image in a new tab.

目前為 2014-11-10 提交的版本,檢視 最新版本

// ==UserScript==
// @name        Open Tweet Image
// @author      Arctosmous
// @namespace   https://www.googledrive.com/host/0B0T32ON-a3StUWZGUW9TbFZCVHM/
// @description A shitty thrown together script to open a tweets image in a new tab.
// @include     https://twitter.com/*
// @exclude     https://twitter.com/settings/*
// @grant       none
// @version     1.0.0
// ==/UserScript==

OpenTweetImage = {
    getImageURL: function()
    {
        return $(".Gallery-content > .Gallery-media > .media-image").attr("src");
    },
    
    createButton: function()
    {
        $(".Gallery-content").prepend('<a id="OpenTweetImage" class="modal-btn" role="button" style="position: absolute; right: -30px; padding: 0; height: auto; top: 40px; color: white;"><span class="Icon Icon--photo Icon--large"><span class="visuallyhidden">Open image in new tab</span></span></a>');
    },
    
    buttonClickHandler: function()
    {
        $("body").on("click", "#OpenTweetImage", function () {
            window.open(OpenTweetImage.getImageURL(), "_blank");
        });
    }
}

window.addEventListener("load", function() {
    // script injection
    OpenTweetImage.createButton();
    OpenTweetImage.buttonClickHandler();
}, false);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址