Direct Wmode

An userscript to make flash object display in "direct" mode.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name		Direct Wmode
// @description	An userscript to make flash object display in "direct" mode.
// @namespace	eight04.blogspot.com
// @include		http://www.example.com/
// @version 	0.1.1
// @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);
}