您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This little script replaces Instagram's player with the native one built in browser
当前为
// ==UserScript== // @name Instagram-native-player // @namespace Kenya-West // @version 0.3 // @description This little script replaces Instagram's player with the native one built in browser // @author Kenya-West // @include *instagram.com* // @grant none // ==/UserScript== (function () { 'use strict'; window.onload = getRid; window.addEventListener('popstate', getRid); window.addEventListener('hashchange', getRid); //a hook for a url path change var _wr = function (type) { var orig = history[type]; return function () { var rv = orig.apply(this, arguments); var e = new Event(type); e.arguments = arguments; window.dispatchEvent(e); return rv; }; }; history.pushState = _wr('pushState'), history.replaceState = _wr('replaceState'); //Chrome only feature... perhaps window.addEventListener('replaceState', function (e) { getRid(); }); function getRid() { if (document.querySelector("._c2kdw")) document.querySelector("._c2kdw").remove(); if (document.querySelector("._80v0r")) document.querySelector("._80v0r").remove(); if (document.querySelector("._7thjo")) document.querySelector("._7thjo").remove(); if (document.querySelector("._j12ff")) document.querySelector("._j12ff").remove(); if (document.querySelector("._sajt6")) document.querySelector("._sajt6").remove(); var video = document.querySelector("._l6uaz"); if (video && video.hasAttribute("controls")) { video.removeAttribute("controls"); } else if (video) { video.setAttribute("controls", "controls"); } video.play(); console.log("Successfully replaced Instagram videoplayer with a native one"); //production::enable } })();