您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
An userscript to make flash object display in "direct" mode.
当前为
- // ==UserScript==
- // @name Direct Wmode
- // @description An userscript to make flash object display in "direct" mode.
- // @namespace eight04.blogspot.com
- // @version 0.1.0
- // @grant none
- // ==/UserScript==
- new MutationObserver(cleanContainer).observe(document.body, {
- childList: true,
- subtree: true
- });
- function cleanContainer(){
- var nodes = document.querySelectorAll("object>param[name='wmode']");
- var i;
- var swap = [];
- var len;
- for (i = 0, len = nodes.length; i < len; i++) {
- swap[i] = nodes[i];
- }
- for (i = 0; i < len; i++) {
- swap[i].setAttribute("value", "direct");
- }
- }
- function clean(object) {
- var clone = object.cloneNode(true);
- var param = clone.querySelector("[name=wmode]");
- if (!param) {
- return;
- }
- if (param.getAttribute("value") == "direct") {
- return;
- }
- param.setAttribute("value", "direct");
- object.parentNode.replaceChild(clone, object);
- }