mwalcott3 / Custom Dictionry - Template

// ==UserScript==
// @name         Custom Dictionry - Template
// @version      0.0.1
// @description  Custom Translation Dictionary Template
// @author       mwalcott3
// @include      *://*.uukanshu.com/b/*/*
// @grant        none
// @license      MIT; https://opensource.org/licenses/MIT
// ==/UserScript==

(function() {
    'use strict';
    //Changes per site/book
    let content = document.getElementById('contentbox');
    let dictionary = {
        'chinese': 'english',
    };
    //Stays the same
    let pattern = new RegExp(Object.keys(dictionary).join('|'), 'g');
    content.innerHTML = content.innerHTML.replace(pattern, (match) => {
        return dictionary[match];
    });
})();