Greasy Fork 还支持 简体中文。

Kanji prompt jpdb.io

Press C on back of a review card to open a prompt with kanji that's currently being reviewed.

  1. // ==UserScript==
  2. // @name Kanji prompt jpdb.io
  3. // @namespace Violentmonkey Scripts
  4. // @match https://jpdb.io/review*
  5. // @grant none
  6. // @version 1.0
  7. // @author -
  8. // @license MIT
  9. // @description Press C on back of a review card to open a prompt with kanji that's currently being reviewed.
  10. // ==/UserScript==
  11.  
  12. function copyToClipboard(text) {
  13. window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
  14. }
  15.  
  16. function myKeyListener(e) {
  17. if (e.key !== 'c') {
  18. return;
  19. }
  20.  
  21. const urlPrefix = "https://jpdb.io/review?c=kb%2C";
  22. const currentUrl = decodeURI(location.href);
  23. if (!currentUrl.startsWith(urlPrefix)) {
  24. return;
  25. }
  26.  
  27.  
  28. copyToClipboard(currentUrl.charAt(urlPrefix.length));
  29. }
  30.  
  31. document.addEventListener("keyup", myKeyListener, false)