H-Flash Downloader

Create swf download link on the info bar

Ajankohdalta 6.4.2022. Katso uusin versio.

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

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.

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

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

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         H-Flash Downloader
// @name:zh-cn
// @name:en
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  Create swf download link on the info bar
// @author       sini
// @match        https://h-flash.com/*
// @icon         
// @grant        GM.xmlHttpRequest
// @license      GPLv3
// ==/UserScript==

function create_dl(downpath,downname){
    var dl=document.createElement('A');
    var dlText=document.createTextNode("⬇️Download");
    dl.href=downpath;
    dl.download=downname;
    dl.appendChild(dlText);
    dl.className="Download Link"
    dl.onmouseout=function(ev){
        ev.target.style.color="#000000";
    }
    dl.onmouseover=function(ev){
        ev.target.style.color="#FF00FF";
    }
    return dl;
}
function add_dl(downpath,downname,parentE){
    var dl=create_dl(downpath,downname);
    var span0=parentE.getElementsByTagName("span")[0];
    parentE.insertBefore(dl,span0);
}
function add_dl_by_url(urlt,parentE){
    GM.xmlHttpRequest({
        method: "GET",
        url: urlt,
        onload: function(response) {
            var t=response.responseText;
            var sBegin=t.search("var downpath");
            var sEnd=t.search("var downallow")
            t=t.substring(sBegin,sEnd);
            eval(t);
            add_dl(downpath,downname,parentE);
        }
    });
}
var last=0;
function add_lite_dl(){
    var e=document.getElementsByClassName("gamebox");
    var e_dl=e[0].getElementsByClassName("Download Link");
    if(e_dl.length==0){
        last=0;
    }
    while(last<e.length){
        add_dl_by_url(e[last].href,e[last]);
        last++;
    }
}

(function() {
    'use strict';

    // Your code here...
    if(typeof(downpath)!='undefined'){
        var e=document.getElementsByClassName("rankinfo");
        add_dl(downpath,downname,e[0]);
    }
    setInterval(add_lite_dl,1000);
})();