🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

NinjaKiwi - Low Quality Flash

Sets the flash player to low/med/high quality. You can choose the quality

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name        NinjaKiwi - Low Quality Flash
// @namespace   http://userscripts.org/users/23652
// @description Sets the flash player to low/med/high quality. You can choose the quality
// @include     http://ninjakiwi.com/Games/*/Play/*.html*
// @include     https://ninjakiwi.com/Games/*/Play/*.html*
// @include     http://staging.ninjakiwi.com/Games/*/Play/*.html*
// @include     https://staging.ninjakiwi.com/Games/*/Play/*.html*
// @copyright   JoeSimmons
// @version     1.0.2
// @license     GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @require     https://greasyfork.org/scripts/1885-joesimmons-library/code/JoeSimmons'%20Library.js?version=7915
// @grant       GM_getValue
// @grant       GM_setValue
// ==/UserScript==

(function () {

    function promptQuality() {
        var userQuality = prompt('Enter a quality - low/medium/high', GM_getValue('quality', 'low') );
        return (userQuality + '').toLowerCase().replace(/^\W*(\w+)[\W\w]*$/g, '$1');
    }

    function validQuality(quality) {
        return /low|medium|high/i.test(quality);
    }

    function setQuality() {
        var quality = promptQuality();
        if( validQuality(quality) ) {
            GM_setValue('quality', quality);
        }
    }

    // Make sure the page is not in a frame
    if (window.self !== window.top) { return; }

    JSL.runAt('end', function () {
        var game = JSL('#game'),
            e = JSL('#game param[name="quality"]'),
            wmode = JSL.create('param', {name : 'wmode', value : 'direct'}),
            quality;

        if (game.exists && e.exists) {
            quality = GM_getValue('quality', '')  || promptQuality();

            if ( !validQuality(quality) ) {
                alert('Invalid quality - "' + quality + '".\n\nPlease reload and enter a valid quality.');
            } else if ( quality !== e.attribute('value') ) {
                // set the quality
                e.attribute('value', quality);

                // append a wmode=direct param tag
                game.append(wmode);

                // save the quality you entered
                GM_setValue('quality', quality);

                // reload the game because the quality won't change otherwise
                game.attribute('data', game.attribute('data') );
            }
        }

        // add the change quality button
        JSL('html > body').append(
            JSL.create('input', {id : 'setquality', type : 'button', value : 'Set Flash Quality', style : 'position: fixed; bottom: 2px; right: 2px; font-size: 12pt; font-family: "myriad pro", sans-serif, "times new roman", arial; padding: 2px 10px;'})
        );
        JSL('input#setquality')[0].addEventListener('click', setQuality, false);
    });

}());