JPDB Custom Glossary fix

Deals with html code that jpdb-connect throws at a custom definition when the "definition" field is set to "glossary"

  1. // ==UserScript==
  2. // @name JPDB Custom Glossary fix
  3. // @version 1
  4. // @grant none
  5. // @author Ras#0612
  6. // @description Deals with html code that jpdb-connect throws at a custom definition when the "definition" field is set to "glossary"
  7. // @match https://jpdb.io/review*
  8. // @match https://jpdb.io/vocabulary/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=jpdb.io
  10. // @run-at document-start
  11. // @license MIT
  12.  
  13. // @run-at document-idle
  14. // @namespace https://greasyfork.org/users/1092001
  15. // ==/UserScript==
  16.  
  17. window.addEventListener('load', function() {
  18. var elements = document.querySelectorAll(".mnemonic.custom-meaning");
  19.  
  20. for (var i = 0; i < elements.length; i++) {
  21. elements[i].innerHTML = elements[i].innerHTML.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
  22. }
  23. }, false);