您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Avoid having to use Flash Player to watch videos. No ads.
当前为
- // ==UserScript==
- // @name HTML5 player for Metacritic
- // @namespace https://greasyfork.org/users/4813-swyter
- // @description Avoid having to use Flash Player to watch videos. No ads.
- // @match http://www.metacritic.com/*
- // @version 2015.11.19
- // @noframes
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- /* wait until the page is ready for the code snipped to run */
- document.addEventListener('DOMContentLoaded', function()
- {
- window.MetaC = window.MetaC || {};
- window.MetaC.CANPlayer = window.MetaC.CANPlayer || {};
- /* override the flash video function and call it a day */
- Object.defineProperty(window.MetaC.CANPlayer, 'initPlayer',
- {
- configurable: false,
- writable: false,
- value: function(elem, width, height, options)
- {
- console.info("check overriden! video arguments =>", arguments);
- v = document.createElement("video");
- v.width = width;
- v.height = height;
- v.src = options[0].assetURL;
- v.poster = options[0].prevImg;
- v.controls = 'true';
- /* replace the old SWF Flash object with it, voilà */
- elem = document.getElementById(elem);
- elem.parentNode.replaceChild(v, elem);
- console.log("video replaced =>", v, elem);
- }
- });
- });