[email protected]

place a bookmark automatically when you open a chapter

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        [email protected]
// @namespace   zhang
// @description place a bookmark automatically when you open a chapter
// @include     http://www.du00.com/read/*/*/*.html
// @grant       GM_log
// @version     1
// ==/UserScript==


var ajax_prefix = 'javascript:Ajax.Request(';

var linkright = document.getElementById('linkright');
if (linkright) {
    var links = linkright.getElementsByTagName('a');
    for (var i = 0; i < links.length; i++) {
        var link = links[i];
        if (link.text == '加入书签') {
            if (link.href.substring(0, ajax_prefix.length) == ajax_prefix) {
                var quote = link.href.charAt(ajax_prefix.length);
                if (quote == "'" || quote == '"') {
                    var start = ajax_prefix.length + 1;
                    var end = link.href.indexOf(quote, start);
                    if (end > start) {
                        var url = link.href.substring(start, end);
                        //GM_log(url);
                        unsafeWindow.Ajax.Request(url);
                    }
                }
            }
        }
    }
}