您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically promotes GfyCat gif pages to raw WebM video
- // ==UserScript==
- // @name GfyCat Redirect to WebM Video File
- // @namespace gfycatVideoRedirect_kk
- // @description Automatically promotes GfyCat gif pages to raw WebM video
- // @version 0.2
- // @author Kai Krause <kaikrause95@gmail.com>
- // @match http://gfycat.com/*
- // @match https://gfycat.com/*
- // @grant none
- // @run-at document-end
- // ==/UserScript==
- // gifycat.com/gifs/detail/id
- var videoPlayer = document.getElementsByTagName('video')[0];
- if (videoPlayer) {
- var children = videoPlayer.childNodes;
- for (var i = 0; i < children.length; ++i) {
- if (children[i].type == "video/webm") {
- var webm = children[i].src;
- break;
- }
- }
- } else {
- // gifycat.com/id
- var webm = document.getElementById('webmSource').src;
- var mp4 = document.getElementById('mp4Source').src;
- }
- if (webm) {
- location.assign(webm);
- } else if (mp4) {
- location.assign(mp4);
- }