Kongregate Flash games fixer

You can now chose between Flash and SuperNova to play Flash games on Kongregate!

目前為 2022-02-26 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Kongregate Flash games fixer
// @version      3.3.3
// @author       Matrix4348
// @namespace    https://gf.qytechs.cn/users/4818
// @description  You can now chose between Flash and SuperNova to play Flash games on Kongregate!
// @license      MIT
// @match        *://*.konggames.com/games/*/*/frame/*
// @match        *://www.kongregate.com/games/*/*
// @grant        none
// ==/UserScript==

// Iframes part. The script must be limited to Flash iframes (the URL for the html games iframes look a bit different, but there may be some exceptions), so we will check if the iframe includes the variable kong_flash_variables.
if ((document.URL.search("/frame/")>-1)&(document.body.innerHTML.search("kong_flash_variables")>-1)){

    // First, we need to extract the link to the swf (the game file) and a few other things.
    var file_url0, file_url, file_url_base; // Basic URL.
    var my_first_link, my_second_link, blablabla, GameShellAPI; // For loading the games in a gameshell when they should, because in these cases the gameshell is required for submitting scores.
    var SNwidth, SNheight, my_bgcolor; // Parameters.
    var scripts=document.getElementsByTagName("script");
    for(var i=0; i<scripts.length;i++) {var script_text=scripts[i].text;
                                        var url_text;
                                        if(script_text.indexOf("game_swf")!== -1) {
                                            url_text=script_text.match(`game_swf":"(.*?)"`)[1];
                                            file_url0="https://"+decodeURIComponent(url_text.substring(6,url_text.length));

                                            // Background color parameter for swf injection.
                                            my_bgcolor=script_text.match(`bgcolor":"(.*?)"`)[1];

                                            //  Flash, game shell and API.
                                            blablabla=script_text.match(`swfurl\"\:\"(.*?)\"`)[1];
                                            my_first_link=blablabla.substring(blablabla.search("//"),blablabla.length);
                                            my_second_link=encodeURIComponent("http:"+file_url0.substring(file_url0.search("//"),file_url0.length)); // HTTPS WILL NOT MAKE THE API LOAD!
                                            GameShellAPI=decodeURIComponent(script_text.match(`kongregate_api_path":"(.*?)"`)[1]);

                                            // Values for the SuperNova part. Note that they will only be correctly defined if they have three digits, which should always be the case.
                                            SNwidth=script_text.match(`width":(.*?),`)[1];
                                            SNheight=script_text.match(`height":(.*?)}`)[1];

                                            break;
                                        }
                                        else if(script_text.indexOf("swfurl")!== -1) {
                                            url_text=script_text.match(`swfurl\"\:\"(.*?)\"`)[1];
                                            file_url0=decodeURIComponent(url_text);

                                            // Background color parameter for swf injection.
                                            my_bgcolor=script_text.match(`bgcolor":"(.*?)"`)[1];

                                            //  Flash, game shell and API (even though, in this part of the loop, games do not need game shells).
                                            my_first_link=file_url0.substring(file_url0.search("//"),file_url0.length);
                                            my_second_link="";
                                            GameShellAPI="";

                                            // Values for the SuperNova part. Note that they will only be correctly defined if they have three digits, which should always be the case.
                                            SNwidth=script_text.match(`width":(.*?),`)[1];
                                            SNheight=script_text.match(`height":(.*?)}`)[1];

                                            break;
                                        };
                                       };
    file_url=file_url0.substring(file_url0.search("//"),file_url0.length);
    if (file_url.search("/live/")>-1){
        file_url_base="http:"+file_url.substring(0,file_url.search("/live/")+6);
    }
    else {
        file_url_base="http:"+file_url.substring(0,file_url.search("/game_files/")+22);
    };

    // Then, we build the functions that will load the games.
    function more_players(){
        var a=document.createElement("script");
        a.id="More choice";
        a.type="text/javascript";
        // IMPORTANT: The checkParams function (originally present in the webpage) inputs most of the flashvars into kong_flash_variables.
        a.innerHTML=`
//<![CDATA[
FlashLoader = {
    loadGame: function(urlOptions) {
        var swf_location = "`+my_first_link+`";
        var swfobject_flash_vars = {};
        if(typeof(kong_flash_variables) == "object"){
            for(var k in kong_flash_variables){ swfobject_flash_vars[k] = encodeURIComponent(kong_flash_variables[k]); };

            // Score API (re)activation first part:
            swfobject_flash_vars.kongregate_flash_postmessage=true; // This line alone activates the API for a few (recent?) games.
            swfobject_flash_vars.api_path=swfobject_flash_vars.kongregate_api_path; // This one, combined with the previous one, will activate the API for most of the remaining ones.
            swfobject_flash_vars.api_host=swfobject_flash_vars.kongregate_api_host; // Needed? Useless?
            swfobject_flash_vars.game_url=swfobject_flash_vars.kongregate_game_url; // May be useless, or may reactivate API on games where we supposed it broken for good, who knows...
            swfobject_flash_vars.kongregate_stamp=swfobject_flash_vars.kongregate_game_auth_token; // May be useless, or may reactivate API on games where we supposed it broken for good, who knows...
        }

        // Score API (re)activation second part (relevant for game shell cases only):
        gameswfifgameshell="`+my_second_link+`";
        if(gameswfifgameshell.length!=0){
            swfobject_flash_vars.game_swf=gameswfifgameshell;
            swfobject_flash_vars.kongregate_api_path=encodeURIComponent("`+GameShellAPI+`"); // Yep, game shells need a different API file!
            swfobject_flash_vars.api_path=swfobject_flash_vars.kongregate_api_path;
        };

        if(document.getElementById("game_wrapper").firstDescendant()!=null){document.getElementById("game_wrapper").firstDescendant().remove();};
        var d=document.createElement("div");
        d.id="gamediv";
        document.getElementById("game_wrapper").appendChild(d);
        swfobject.embedSWF(swf_location, "gamediv","100%","100%","6","/flash/expressInstall.swf",swfobject_flash_vars,{"bgcolor":"`+my_bgcolor+`","allownetworking":"all","allowscriptaccess":"always","base":"`+file_url_base+`"},{});

        // Sometimes, if a browser does not support Adobe Flash Player, then swfobject.embedSWF may not work, leaving a mere black screen instead of a "this plugin is not supported" message.
        // Therefore, the game will be injected using another method, just so the users know that the script works.
        if (document.getElementById("gamediv").type==undefined){
            document.getElementById("gamediv").remove();
            var truc=document.createElement("object");
            truc.id="gamediv";
            truc.type="application/x-shockwave-flash";
            truc.data="`+my_first_link+`"
            truc.width="100%";
            truc.height="100%";
            var bgc=document.createElement("param"); bgc.name="bgcolor"; bgc.value="`+my_bgcolor+`"; truc.appendChild(bgc);
            var anw=document.createElement("param"); anw.name="allownetworking"; anw.value="all"; truc.appendChild(anw);
            var asa=document.createElement("param"); asa.name="allowscriptaccess"; asa.value="always"; truc.appendChild(asa);
            var b=document.createElement("param"); b.name="base"; b.value="`+file_url_base+`"; truc.appendChild(b);
            var fv0=""; for(var k in swfobject_flash_vars){fv0=fv0+k+"="+swfobject_flash_vars[k]+"&"};
            var fv=document.createElement("param"); fv.name="flashvars"; fv.value=fv0.substring(0,fv0.length-1); truc.appendChild(fv);
            document.getElementById("game_wrapper").appendChild(truc);
        };
    }
}

function play_with_Flash(urlOptions) {
    if (!urlOptions) {
        urlOptions = '';
    }
    FlashLoader.loadGame(urlOptions);
    document.fire('game:activated');
};

function play_with_SuperNova(){
    var SNoptions = {
        "swfurl" : "http:`+file_url+`",
        "flashvars":"",
        "title" : ttgArgs.game_title,
        "width" : `+SNwidth+`,
        "height" : `+SNheight+`
    };

    function SNsetEverything(A){
        if(typeof(kong_flash_variables) === 'object'){
            var kong_flash_variables_and_more=kong_flash_variables; // MANDATORY IF WE NEED TO ADD MORE FLASHVARS, BECAUSE $j.param MAKES A BIG STRING OF CHARACTERS!
            SNoptions.flashvars = $j.param(kong_flash_variables_and_more);
            if(document.getElementById("game_wrapper").firstDescendant()!=null){document.getElementById("game_wrapper").firstDescendant().remove();};
            var d=document.createElement("div");
            d.id="gamediv";
            document.getElementById("game_wrapper").appendChild(d);
            SNoptions.el = document.querySelector('#gamediv');
            setTimeout(function(){delete SNsetEverything;},1);
        }
        else if(A){setTimeout(function(B){SNsetEverything(B);},10000,A--);}
        else{setTimeout(function(){delete SNsetEverything;},1);}
    };
    SNsetEverything(10);

    var still_no_supernova=true;
    function SNloadGame(A){
        if(typeof(supernova)==='object'){
            supernova.launch(SNoptions);
            supernova.openGame(SNoptions);
            still_no_supernova=false;
            setTimeout(function(){delete SNloadGame;},1);
        }
        else if(A){setTimeout(function(B){SNloadGame(B);},5000,A-1);}
        else{setTimeout(function(){
                // The SuperNova code does not work in some browsers (like Pale Moon and Basilisk), therefore the window will not know what is supernova.
                // However, we can still open the game using the "manual" command.
                if (still_no_supernova){
                    manual_launch="supernova://play/?swfurl="+encodeURIComponent(SNoptions.swfurl)+"/?flashvars="+encodeURIComponent(SNoptions.flashvars);
                    window.location=manual_launch;
                    var unofficial_interface=document.createElement("div");
                    var Roboto_stylesheet=document.createElement("link"), interface_subdiv=document.createElement("div");
                    var intro_div=document.createElement("div"), first_line=document.createElement("hr"), download_div=document.createElement("div"), second_line=document.createElement("hr"), play_div=document.createElement("div");
                    var download_button_div=document.createElement("div"), download_button=document.createElement("button"), download_span=document.createElement("span"), warning_span=document.createElement("span");
                    var play_div=document.createElement("div"), play_button_div=document.createElement("div"), play_button=document.createElement("button"), button_span=document.createElement("span");
                    unofficial_interface.id="Unofficial SuperNova interface"; unofficial_interface.style="text-align: center; background:#FFFFFF; left: 0px; top:0px; width:100%; height:100%; position:absolute";
                    Roboto_stylesheet.rel="stylesheet"; Roboto_stylesheet.type="text/css"; Roboto_stylesheet.href="https://fonts.googleapis.com/css?family=Roboto";
                    unofficial_interface.appendChild(Roboto_stylesheet);
                    interface_subdiv.style="text-align:center; align-items:center; background:#FFFFFF; width:100%; height:100%; position:fixed; font-family: Roboto; font-style: normal; font-weight: 500; line-height: normal; overflow:auto";
                    intro_div.id="Introduction"; intro_div.style="display:block; position: relative; width: 90%; height:auto; top:4%; left: 5%; right: 15%";
                    intro_div.innerHTML="It seems that your browser could not load the official SuperNova interface (probably because this browser is not fully compatible with the SuperNova code, or maybe simply because the page loaded veeeery slowly), which explains why you are reading this. Well, fear not! The rest of the process stays the same."
                    interface_subdiv.appendChild(intro_div);
                    first_line.style="margin-top:6%; margin-bottom:3%";
                    interface_subdiv.appendChild(first_line);
                    download_div.id="Download SuperNova"; download_div.style="display:block; position: relative; width: 90%; height:auto; top:auto; left: 5%; right: 15%";
                    download_div.innerHTML="To play <i>"+SNoptions.title+"</i> with the SuperNova player, you first need to download the SuperNova player from <i>https://www.getsupernova.com/download/</i> and install it.";
                    download_button_div.id="Download button"; download_button_div.style="margin-top:2%";
                    download_button.id="downloadbutton"; download_button.style="background: #0D5694; color: white; height:40px";
                    download_button.setAttribute("onclick", "window.location='https://cdn.getsupernova.com/SuperNovaSetup.exe'");
                    download_span.style="left:50px; font-weight: 700; text-decoration:underline; font-size:20px";
                    download_span.innerHTML="Download";
                    download_button.appendChild(download_span);
                    download_button_div.appendChild(download_button);
                    download_div.appendChild(download_button_div);
                    warning_span.style="font-size:12px"; warning_span.innerHTML="(Warning: At the moment, it is only available on Windows.)";
                    download_div.appendChild(warning_span);
                    interface_subdiv.appendChild(download_div);
                    second_line.style="margin-top:3%; margin-bottom:4%";
                    interface_subdiv.appendChild(second_line);
                    play_div.id="Play with SuperNova"; play_div.style="display: block; position:relative; width: 90%; height:auto; top:auto; left: 5%; right: 15%; bottom:4%";
                    play_div.innerHTML="Once you have the SuperNova player installed on your computer, you can play the game.";
                    play_button_div.id="Play button"; play_button_div.style="margin-top:3%";
                    play_button.id="playbutton"; play_button.style="border-radius: 30px; background: #0D5694; color: white; margin: 0px; width: 180px; height: 26px; font-size: 14px; border: none";
                    play_button.setAttribute("onclick", "window.location=manual_launch");
                    button_span.style="font-size:15px"; button_span.innerHTML="Play";
                    play_button.appendChild(button_span);
                    play_button_div.appendChild(play_button);
                    play_div.appendChild(play_button_div);
                    interface_subdiv.appendChild(play_div);
                    unofficial_interface.appendChild(interface_subdiv);
                    document.getElementById("game_wrapper").appendChild(unofficial_interface);
                };
                delete SNloadGame;
        },1);}
    };
    SNloadGame(3);
};

function play_with_Ruffle(){ // If it does not work, try also putting the instructions inside an onload parameters of ruffle.js, instead of loading ruffle.js, then another script.
    var r=document.createElement("script");
    r.type="text/javascript";
    r.src=""; // Sadly, the script must be on the Kongregate servers... Curse on that same-origin policy!
    document.body.appendChild(r);
    var swf_location = "`+file_url+`";
    var swfobject_flash_vars = {};
    if(typeof(kong_flash_variables) == "object"){
        for(var k in kong_flash_variables){
            swfobject_flash_vars[k] = encodeURIComponent(kong_flash_variables[k]);
        }
    }
    // In case of activation: remember to add the same extra flashvars, like for Flash, so the API will work.
    if(document.getElementById("game_wrapper").firstDescendant()!=null){document.getElementById("game_wrapper").firstDescendant().remove();};
    var RandomFunctionName=function(A){
        if(window.RufflePlayer!=null){
            window.RufflePlayer.config = {
                "publicPath": undefined,
                "contextMenu": true,
                "showSwfDownload": true,
                "menu": true,
                "quality": "high",
            };
            const ruffle = window.RufflePlayer.newest();
            const player = ruffle.createPlayer();
            const container = document.getElementById("game_wrapper");
            container.appendChild(player);
            player.load({
                url: swf_location,
                parameters: swfobject_flash_vars,
                allowScriptAccess: true
            });
            setTimeout(function(){delete RandomFunctionName;},1);
        }
        else if(A){setTimeout(function(B){RandomFunctionName(B);},10000,A--);}
        else{setTimeout(function(){delete RandomFunctionName;},1);}
    };
    RandomFunctionName(10);
};

function time_to_play(){
    // I do not know exactly what channel_id is for. All I know is that it is in the iframe link and elsewhere, and that is is some kind of hexadecimal character string.
    // Thus, the presence of a modified (and unusual) channel_id in the iframes' URL will be used to tell which player we want to use.
    // Moreover, changing it only in the URL SEEMS not to change the value used for the flashvars.

    // If we want the game to load with Flash:
    if(document.URL.search("me-wanna-Flash")>-1){ play_with_Flash(); }
    // If we want the game to load (properly!) with SuperNova:
    else if(document.URL.search("me-wanna-SuperNova")>-1){ play_with_SuperNova(); }
    // If we want the game to load with Ruffle:
    else if(document.URL.search("me-wanna-Ruffle")>-1){ play_with_Ruffle(); }
    // When the iframe loads normally (without a modified channel_id):
    else{
        function BrowVer(){ua=navigator.userAgent; return {Browser:ua.substring(ua.lastIndexOf(" ")+1,ua.lastIndexOf("/")),Version:ua.substring(ua.lastIndexOf("/")+1,ua.length)}};
        var b=BrowVer.Browser, v=BrowVer.Version;
        function FlashSupport(){
            var np=navigator.plugins, npl=np.length;
            for(var k=0;k<npl;k++){ if(np[k].name=="Shockwave Flash"){return true}; }
            return false;
        };

        if(navigator.userAgent.search("Windows")==-1){ play_with_Flash(); } // Because SuperNova only works on Windows.
        else if(FlashSupport()==false){ play_with_SuperNova(); }
        else if(FlashSupport()==true){ play_with_Flash(); }

        else if((b=="Edg")||(b=="Chrome")||(b=="Safari")){ play_with_SuperNova(); } // Useless but
        else if((b=="Basilisk")||(b=="PaleMoon")){ play_with_Flash(); }             // could be useful
        else if((b=="Firefox")||(v<85)){ play_with_Flash();  }                      // in case of
        else if((b=="Firefox")||(v>=85)){ play_with_SuperNova();  }                 // a Ruffle
        else { play_with_Flash(); }                                                 // implementation.
    }
};
var time_to_play_but_at_the_correct_time=function(a){
    if(activateGame._alreadyActivated){
        time_to_play();
        setTimeout(function(){delete time_to_play_but_at_the_correct_time;},1);
    }
    else if(a){setTimeout(function(b){time_to_play_but_at_the_correct_time(b);},10000,a--);}
    else{setTimeout(function(){delete time_to_play_but_at_the_correct_time;},1);}
};
time_to_play_but_at_the_correct_time(10);

//]]>
        `;
        document.body.appendChild(a);
    };
    more_players();
}

// Game pages part. Only for Flash games, so I will make sure that active_user.gameType()="flash".
// I will make two "if" loops instead of one to avoid an error message in the console tab (even though this message would not break anything).
else if (document.URL.search("www.kongregate.com/games/")>-1){
    if(active_user.gameType()=="flash"){
        // Useful variables.
        var urlstart=document.URL.substring(0,document.URL.search("://"));

        var my_game_version, my_svid, my_game_width, my_game_height, my_game_left, my_game_top;
        var game_scripts=document.getElementById("game").getElementsByTagName("script");
        for(var j=0; j<game_scripts.length;j++) {var game_script_text=game_scripts[j].text;
                                                 if((game_script_text.indexOf("game_version")!== -1)&(game_script_text.indexOf("svid")!== -1)) {
                                                     my_game_version=game_script_text.match(`game_version":(.*?),`)[1];
                                                     my_svid=game_script_text.match(`svid":"(.*?)"`)[1];
                                                     my_game_width=game_script_text.match(`game_width":(.*?),`)[1];
                                                     my_game_height=game_script_text.match(`game_height":(.*?),`)[1];
                                                     my_game_left=game_script_text.match(`game_left":(.*?),`)[1];
                                                     my_game_top=game_script_text.match(`game_top":(.*?),`)[1];
                                                     break;
                                                 }
                                                };

        // What will be inserted in the webpage, to load the different iframes we will use.

        // I do not know what channel_id is used for, nor weither or not it is relevant as it changes everytime the game page is reloaded, but yet appears in the iframe link.
        // All I know is that is is some kind of hexadecimal characters string.
        // Thus, I will replace it with values that it will never take so that the script can detect which player it should load the game with.

        var ic=document.createElement("script");
        ic.id="iframe constructors";
        ic.innerHTML=`
//<![CDATA[
FlashLoader = {
    loadGame: function(urlOptions) {
        new GameIframe({
            "auto_resize":null,
            "iframe_url":"`+urlstart+`"+"://game"+active_user.gameId()+".konggames.com"+active_user.gamePath()+'/frame/' + "me-wanna-Flash" + '/?kongregate_host=www.kongregate.com',
            "alternate_game_file_url":null,
            "game_width":`+my_game_width+`,
            "game_height":`+my_game_height+`,
            "max_game_width":null,
            "max_game_height":null,
            "game_left":`+my_game_left+`,
            "game_top":`+my_game_top+`,
            "iframe_class":"dont_hide",
            "host":"`+urlstart+`"+"://www.kongregate.com",
            "api_host":"`+urlstart+`"+"://api.kongregate.com",
            "api_path":"https://chat.kongregate.com/flash/API_AS3_d43c4b859e74432475c1627346078677.swf",
            "preview":false,
            "game_permalink":active_user.gamePermalink(),
            "game_id":active_user.gameId(),
            "game_url":"http://www.kongregate.com"+active_user.gamePath(),
            "game_version":`+my_game_version+`,
            "flash_var_prefix":"kv_",
            "post_message":true,
            "iframe_host":"`+urlstart+`"+"://game"+active_user.gameId()+".konggames.com",
            "game_host":"`+urlstart+`"+"://chat.kongregate.com",
            "channel_id":encodeURIComponent(channel_id),
            "svid":"`+my_svid+`",
            "game_type":"flash"
        },urlOptions, channel_id).createGameIframeElement();
    }
}

function LoadFlashIframe(urlOptions) {
    if (!urlOptions) { urlOptions = ''; }
    FlashLoader.loadGame(urlOptions);
    document.fire('game:activated');
};

SuperNovaLoader = {
    loadGame: function(urlOptions) {
        new GameIframe({
            "auto_resize":null,
            "iframe_url":"`+urlstart+`"+"://game"+active_user.gameId()+".konggames.com"+active_user.gamePath()+'/frame/' + "me-wanna-SuperNova" + '/?kongregate_host=www.kongregate.com',
            "alternate_game_file_url":null,
            "game_width":`+my_game_width+`,
            "game_height":`+my_game_height+`,
            "max_game_width":null,
            "max_game_height":null,
            "game_left":`+my_game_left+`,
            "game_top":`+my_game_top+`,
            "iframe_class":"dont_hide",
            "host":"`+urlstart+`"+"://www.kongregate.com",
            "api_host":"`+urlstart+`"+"://api.kongregate.com",
            "api_path":"https://chat.kongregate.com/flash/API_AS3_d43c4b859e74432475c1627346078677.swf",
            "preview":false,
            "game_permalink":active_user.gamePermalink(),
            "game_id":active_user.gameId(),
            "game_url":"http://www.kongregate.com"+active_user.gamePath(),
            "game_version":`+my_game_version+`,
            "flash_var_prefix":"kv_",
            "post_message":true,
            "iframe_host":"`+urlstart+`"+"://game"+active_user.gameId()+".konggames.com",
            "game_host":"`+urlstart+`"+"://chat.kongregate.com",
            "channel_id":encodeURIComponent(channel_id),
            "svid":"`+my_svid+`",
            "game_type":"flash"
        },urlOptions, channel_id).createGameIframeElement();
    }
}

function LoadSuperNovaIframe(urlOptions) {
    if (!urlOptions) { urlOptions = ''; }
    SuperNovaLoader.loadGame(urlOptions);
    document.fire('game:activated');
};

RuffleLoader = {
    loadGame: function(urlOptions) {
        new GameIframe({
            "auto_resize":null,
            "iframe_url":"`+urlstart+`"+"://game"+active_user.gameId()+".konggames.com"+active_user.gamePath()+'/frame/' + "me-wanna-Ruffle" + '/?kongregate_host=www.kongregate.com',
            "alternate_game_file_url":null,
            "game_width":`+my_game_width+`,
            "game_height":`+my_game_height+`,
            "max_game_width":null,
            "max_game_height":null,
            "game_left":`+my_game_left+`,
            "game_top":`+my_game_top+`,
            "iframe_class":"dont_hide",
            "host":"`+urlstart+`"+"://www.kongregate.com",
            "api_host":"`+urlstart+`"+"://api.kongregate.com",
            "api_path":"https://chat.kongregate.com/flash/API_AS3_d43c4b859e74432475c1627346078677.swf",
            "preview":false,
            "game_permalink":active_user.gamePermalink(),
            "game_id":active_user.gameId(),
            "game_url":"http://www.kongregate.com"+active_user.gamePath(),
            "game_version":`+my_game_version+`,
            "flash_var_prefix":"kv_",
            "post_message":true,
            "iframe_host":"`+urlstart+`"+"://game"+active_user.gameId()+".konggames.com",
            "game_host":"`+urlstart+`"+"://chat.kongregate.com",
            "channel_id":encodeURIComponent(channel_id),
            "svid":"`+my_svid+`",
            "game_type":"flash"
        },urlOptions, channel_id).createGameIframeElement();
    }
}

function LoadRuffleIframe(urlOptions) {
    if (!urlOptions) { urlOptions = ''; }
    RuffleLoader.loadGame(urlOptions);
    document.fire('game:activated');
};

//]]>
        `;
        document.getElementById("game").appendChild(ic);

        // Let's make some shiny buttons!
        var s=document.createElement("script"), ButtonMaker;
        s.type="text/javascript";
        s.id="Shiny buttons";
        document.head.appendChild(s.appendChild(document.createTextNode('('+function(){
            ButtonMaker=function(x){
                var ql=document.getElementById("quicklinks");
                if(holodeck&&LoadFlashIframe&&ql!==null){
                    // Flash button
                    var FlashButton=document.createElement('li');
                    FlashButton.id="Button to (re)load with Flash";
                    FlashButton.innerHTML='<a href="#" onclick="LoadFlashIframe(); return false">Flash</a>';
                    ql.insert(FlashButton,ql.firstChild);
                    // SuperNova button
                    var SuperNovaButton=document.createElement('li');
                    SuperNovaButton.id="Button to (re)load with SuperNova";
                    SuperNovaButton.innerHTML='<a href="#" onclick="LoadSuperNovaIframe(); return false">SuperNova</a>';
                    ql.insert(SuperNovaButton,ql.firstChild);
                    // Ruffle button
                    var RuffleButton=document.createElement('li');
                    RuffleButton.id="Button to (re)load with Ruffle";
                    RuffleButton.innerHTML='<a href="#" onclick="LoadRuffleIframe(); return false">Ruffle</a>';
                    //ql.insert(RuffleButton,ql.firstChild); //UNHIDE IF THE RUFFLE SCRIPT IS ONE DAY, BY SOME MIRACLE, UPLOADED TO THE KONGREGATE SERVERS.
                    // No more buttons
                    setTimeout(function(){delete ButtonMaker;},1);
                }
                else if(x){setTimeout(function(y){ButtonMaker(y);},10000,x--);}
                else{setTimeout(function(){delete ButtonMaker;},1);}
            };
            ButtonMaker(10);
        }+')()')).parentNode);

    }
};

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址