JBSearch

Replaces JAV code to link on Javbus

// ==UserScript==
// @name         JBSearch
// @namespace    http://tampermonkey.net/
// @version      2024-06-09
// @description  Replaces JAV code to link on Javbus
// @author       mol73n
// @match        https://jav.guru/*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=jav.guru
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    var titleBlock = document.querySelector("h1.titl");
    let regex = /\[([^\]]+)\]/;

    var titleCode = titleBlock.textContent.match(regex);
    titleBlock.textContent = titleBlock.textContent.replace(titleCode[0], "");

    var searchButton = document.createElement("a");
    searchButton.textContent = titleCode[0];
    searchButton.href = "https://www.javbus.com/" + titleCode[1];

    titleBlock.insertBefore(searchButton, titleBlock.firstChild);
})();