[email protected]

place a bookmark automatically when you open a chapter

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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);
                    }
                }
            }
        }
    }
}