飞机汉化

直接读取图片,不加载播放器

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         飞机汉化
// @version      0.1
// @description  直接读取图片,不加载播放器
// @author       FeiLong
// @match        http://smp.yoedge.com/*
// @match        http://smp1.yoedge.com/*
// @grant        none
// @namespace https://greasyfork.org/users/28687
// ==/UserScript==

(function() {
    'use strict';

    function get(url)
    {
        var xmlHttp = new XMLHttpRequest();
        xmlHttp.open( "GET", url, false );
        xmlHttp.send( null );

        return xmlHttp.responseText;
    }
    
    //console.log(get("smp_cfg.json"));
    var jsoncode = get("smp_cfg.json");
    var json = eval('(' + jsoncode + ')');
    

    
    document.body.innerHTML = "";
    //$.each(json.pages.page,function (i,v){console.log(v);document.body.innerHTML = document.body.innerHTML + '<img width=100% src="' + v + '">';});
    //$.each(json.pages.page,function (i,v){pic[i] = v;});
    
    var pic=[];
    $.each(json.pages.page, function(key, val) { pic[pic.length] = key;  });
    pic.sort();
    $.each(pic, function(i, key) {
        console.log("key = " + json.pages.page[key]); // 访问JSON对象属性
        document.body.innerHTML = document.body.innerHTML + '<img width=100% src="' + json.pages.page[key] + '">';
    });
    
    
    /*
    // Your code here...
    function isExitsVariable(variableName) {
    try {
        if (typeof(variableName) == "undefined") {
            //alert("value is undefined"); 
            return false;
        } else {
            //alert("value is true"); 
            return true;
        }
    } catch(e) {}
    return false;
}
    if(isExitsVariable(smp))
        {document.body.innerHTML = "";for (pagename in smp.loader.pageNames){console.log(smp.controller.pages[smp.loader.pageNames[pagename]]);document.body.innerHTML = document.body.innerHTML + '<img width=100% src="' + smp.controller.pages[smp.loader.pageNames[pagename]] + '">';};}
    else
        {console.log("not in comic page");}
        */
})();