4399游戏下载

flash已死,给4399游戏页面增加下载按钮

// ==UserScript==
// @name         4399游戏下载
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  flash已死,给4399游戏页面增加下载按钮
// @author       You
// @match        http://www.4399.com/flash/*_*.htm
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var nav = document.querySelector(".p-nav");
    var el = document.createElement("a");
    el.text = "下载";
    el.href = window.webServer + window._strGamePath;
    el.style = "font-size: 16px;";
    el.download = nav.firstElementChild.textContent;
    el.target = "_self";
    nav.append(el);
})();