Massif Example Sentence Button

Generates a button linking to Massif, which shows more example sentences of the word.

  1. // ==UserScript==
  2. // @name Massif Example Sentence Button
  3. // @namespace Violentmonkey Scripts
  4. // @match https://jpdb.io/vocabulary/*
  5. // @grant none
  6. // @version 0.2
  7. // @author Alex Chapman 2025
  8. // @license MIT
  9. // @description Generates a button linking to Massif, which shows more example sentences of the word.
  10. // ==/UserScript==
  11.  
  12. const documentQuery = document.querySelector('.hbox');
  13. if (documentQuery) {
  14. // Grab current word
  15. let url = window.location.pathname;
  16. let word = url.split('/')[3];
  17. let decodedWord = decodeURIComponent(word);
  18.  
  19. // Insert button with link to Massif
  20. documentQuery.insertAdjacentHTML('afterend', `
  21. <div class="massif-button" style="font-size: 200%; text-align: left;">
  22. <a href="https://massif.la/ja/search?q=${word}">
  23. <button>Massif Examples for ${decodedWord}</button>
  24. </a>
  25. </div>
  26. `);
  27. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址