JISSEY / Rename Tab to LS Title

// ==UserScript==
// @name         Rename Tab to LS Title
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  This script will rename the current browser tab to the related LifeSelector episode. (default tab title is "LifeSelector", see preview at https://i.imgur.com/kNtCCNd.gif)
// @author       JISSEY
// @match        https://animetiddies.de/lifeselector/*
// @icon         https://i.imgur.com/Frfgzd7.png
// @licence      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var Episode_URL = document.URL;
    var tab_title;
    
    // extract the title from the URL
    tab_title = Episode_URL.match(/.*\/(.*)\//)[1];
    tab_title = tab_title.replaceAll('_', ' ');
    tab_title = tab_title.replace(/(?<=[a-z0-9\-])(?=[A-Z0-9\-])|(?<=[A-Z0-9\-])(?=[A-Z0-9\-][a-z0-9\-])/g, ' ');
    // visit https://regex101.com/r/PKDklV/1 to test this regexp

    document.title = tab_title;

})();