Bunpro Japanese Stack Exchange Search Button

Add Japanese Stack Exchange Search Button

Install this script?
Author's suggested script

You may also like Bunpro Toolbox.

Install this script
  1. // ==UserScript==
  2. // @name Bunpro Japanese Stack Exchange Search Button
  3. // @version 1.0.2
  4. // @description Add Japanese Stack Exchange Search Button
  5. // @author Ambo100
  6. // @match https://bunpro.jp/grammar_points/*
  7. // @grant none
  8. // @namespace https://greasyfork.org/users/230700
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var grammarPoint
  15. var searchURL = "https://japanese.stackexchange.com/search?q=";
  16.  
  17. AddSearchButton();
  18.  
  19. function AddSearchButton()
  20. {
  21. grammarPoint = document.getElementsByClassName("meaning__japanese")[0];
  22. searchURL += grammarPoint.innerText;
  23. grammarPoint.innerHTML += '<a href="' + searchURL + '" target="_blank"> 🔍</a>';
  24. }
  25. }
  26. )();