Userscript: Bunpro Toolbox

The script adds options to instantly search the currently viewed grammar point on Bunpro. The following links will be added to the bottom of each grammar page:

Dictionaries, References

YouTube

  • YouGlish (Provides context sentences detected in Youtube videos)
  • YouTube (Grammar videos)

Q&A, Communities

These links are shown at the bottom of the page for each grammar point.

This script is very simple to customise, you can add, edit, remove or re-order links.


Bonus Features

  • Automatically replace links to web resources that are known to be broken with a Web Archive version. (Jgram, Tanos & 99bako)

  • Automatically add page links for textbooks to your own locally hosted PDF files. (Setup required, see documentation)



Customising Bunpro Toolbox

This script is very simple to customise, you can add, edit, remove or re-order links.

If you are unfamiliar with Javascript, it is recommended that you only edit between the following lines:

//TOOKBOX LINKS START//
//TOOLBOX LINKS END//

Links

Links are added using the AddLink() function. The funtion has three parameters, a link name, prefix (main URL) and a suffix which is optional. The currently viewed grammar point will be placed between the prefix and suffix of the link.

AddLink("Wikitionary", "https://en.wiktionary.org/wiki/","#Japanese");

Links will be ordered in the order in which they are declared in the script.

Use the ClearToolbox() function to clear all the default links and dividers before running your code if you would like to keep the original settings.

Dividers

Section dividers can be added using AddDivider(). The function has a single parameter to adjust margin. The default is set to 10px.

PDF Links

The AddPDFLink() function can links to PDF documents of textbooks stored locally on your PC. Please read the documentation for full details.


WARNING: Customisation of the userscript may be be removed by updates, so you may want to backup your links before updating or disabling auto updates for this script.


Install Userscript

Documentation


Bunpro: List of Scripts

7 Likes

I might add this just for 英辞郎 (Eijirou) alone! That site helps me so much with glossing to and from Japanese phrases/collocations

3 Likes

Yes, I wish more people knew about Eijirou, it really can be quite helpful.

I have updated the script to make it simpler to customise. If anyone has suggestions for links please let me know.

4 Likes

Update 1.1.0

  • Two new links added
  • Section dividers added (with adjustable margins)
1 Like

Update 1.1.1

As a bonus feature, the script will now automatically replace broken links from Jgram and Tanos in the resources section with a Web Archive version:

1 Like

Update 1.5

  • Added a ClearToolbox() function to remove all links and dividers
  • AddDivider() now allows a custom symbol with the ‘dividerSymbol’ attribute
  • Added toolbox link for HiNative

When editing bunpro toolbox, where to I add the pdf command line?

I got confused, is it inside the function AddPDFLink(pdfTitle = ‘’, pdfURL = ‘’, pdfParameters = ‘’){

or do I comment out the example? I would like to add genki, tobira and mina no nihongo pdf files.

Any customisation to the code should be between

//TOOKBOX SETUP START//

and

//TOOKBOX SETUP END//

So for me I would add this line anywhere in there (I do it after the custom links)

AddPDFLink("Genki II 2nd Edition","file:///C:/Users/ambo/Documents/GenkiElementaryII.pdf");

Because you are loading local files you need to replace the file file directory to match yours in the same format. In your case you would add these three lines with your own file path set. (Must be preceeded with ‘file://’)

AddPDFLink("Genki","FILE_PATH_HERE");
AddPDFLink("Tobira","FILE_PATH_HERE");
AddPDFLink("Mina no nihongo","FILE_PATH_HERE");

Keep in mind that if you have your script to automatically update you may lose any edits you have made to the script so keep a copy.

1 Like

I am aware that the recent update update will have broken the functionality of the script, I will work on fixing this as soon as I can.

1 Like

thanks

because after editing the script, it still doesnt recognize the book pdf files.

Unfortunately it will take quite a bit of time to update the script to work the new layout for PDF links, I have just finished fixing the main toolbox links so they are working and I will focus on bringing an update soon so that the core functionality of the script works.

Update 1.5.1

  • Update to fix layout changes to the grammar pages
  • Fixed PDF links for books
  • Moved toolbox to the top of the page
  • Added archived replacements for 99bako links
  • Replaced default divider ‘|’ with space

@evandcs Would you mind updating your script and sending me your setup so I can check what the problem might be?

1 Like