bbs.mottoki.com image url replacer

bbs.mottoki.com image url replacerは画像一覧頁のurlをオリジナルフルサイズ画像のurlに差し替えますhttp*://bbs.mottoki.com/index*で動作します

目前為 2020-01-26 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name     bbs.mottoki.com image url replacer
// @version  1
// @grant    none
// @include  http*://bbs.mottoki.com/index*
// @description bbs.mottoki.com image url replacerは画像一覧頁のurlをオリジナルフルサイズ画像のurlに差し替えますhttp*://bbs.mottoki.com/index*で動作します
// @description:ja bbs.mottoki.com image url replacerは画像一覧頁のurlをオリジナルフルサイズ画像のurlに差し替えますhttp*://bbs.mottoki.com/index*で動作します
// @namespace https://greasyfork.org/users/10885
// ==/UserScript==
// exampleurl http://bbs.mottoki.com/index?bbs=kimottamakaasann&act=album&thread=&page_album=27
// exampleurl http://bbs.mottoki.com/index?bbs=kimottamakaasann&act=img&img=4965
// exampleurl http://bbs.mottoki.com/img/kimottamakaasann/1578698682-9zq398.jpg

var i = 0;
var j = 0;
var url_org = "";
var url_mod = "";
var t = [];
var u = [];

t = document.getElementsByTagName("a");
u = document.getElementsByTagName("img");

for (i = 32; i < 82; i++) {
    if (t[i] != null || t[i] != undefined) {
        console.log("i = " + i);
        if (t[i].getAttribute("href") != null || t[i].getAttribute("href") != undefined) {
            if (t[i].getAttribute("href").includes("/index?bbs=kimottamakaasann&act=img&") === true) {
                for (j = 1; j < 25; j++) {
                    console.log("j = " + j);
                    if (u[j] != null || u[j] != undefined) {
                        if (u[j].getAttribute("src") != null || u[j].getAttribute("src") != undefined) {
                            if (u[j].getAttribute("src").includes("img/kimottamakaasann/s/") === true) {
                                url_org = u[j].getAttribute("src");
                                url_mod = url_org.replace(/\/s\//, "/")
                                console.log("url_org = " + url_org + "|" + "url_mod = " + url_mod);
                                t[i].setAttribute("href", url_mod);
                            }
                        }
                    }
                }
            }
        }
    }
}