Sleazy Fork is available in English.

Open nhentai.net from Tsumino

When clicking on the book cover on a book information page on Tsumino, execute a search by title on nhentai.net and start reading the first result

目前為 2019-05-20 提交的版本,檢視 最新版本

// ==UserScript==
// @name        Open nhentai.net from Tsumino
// @description When clicking on the book cover on a book information page on Tsumino, execute a search by title on nhentai.net and start reading the first result
// @namespace   xspeed.net
// @version     1.0
// @icon        https://static.nhentai.net/img/logo.650c98bbb08e.svg
// @match       *://www.tsumino.com/Book/Info/*
// @grant       GM_xmlhttpRequest
// ==/UserScript==

(function() {
  'use strict';

  if (location.href.indexOf('/Book/Info/') != -1) {
    
    var title = $('.row>.book-title').text();
    
    var ix = title.indexOf('/');
    if (ix != -1) {
      title = title.substring(0, ix);
    }
    
    ix = title.indexOf('|');
    if (ix != -1) {
      title = title.substring(0, ix);
    }
    
    var url = 'https://nhentai.net/search/?q=english ' + title.replace('?', '').replace('&', '').replace('  ', ' ');
    var elem = $('.book-page-cover > a[href^="/Read/View/"]');
    
    elem.attr('href', '#');
    elem.unbind('click');
    elem.click(function() {
      var onerror = function() {
        location.assign(url);
      }
      
      var onload = function(resp) {
        var respDoc = $(resp.responseText);
        var cover = respDoc.find('.cover');
        if (cover) {
          location.assign('https://nhentai.net' + cover.attr('href') + '1/');
        }
        else {
          onerror();
        }
      };

      GM_xmlhttpRequest({ method: "GET", url: url, onload: onload, onerror: onerror });
    });
  }
  
})();