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

AI Learning

  • ChatGPT (Opens ChatGPT and copies a prompt to the users clipboard)

(CAUTION: ChatGPT can be a helpful tool for language learning, but it’s important to remember that its responses may contain inaccuracies or lack context.)

These links are shown at the top 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

  • The script will automatically replace broken links from Jgram and Tanos in the resources section with a Web Archive version.
  • Experimental feature to automatically add page links for textbooks to your own locally hosted PDF files.


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

9 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.

3 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

Update 1.5.2

  • Added Bunpro grammar forum link to the toolbar
  • Added Bunpro Toolbox to the Study page
2 Likes

Is it just me, or does this not work for anyone else, anymore?

It’s been nearly two years since the last update to the script - in that time Bunpro has changed a fair bit so I expect it is safe to say it is not compatible with the current version.

The user interface and website is changing at a fast pace but I will try to send out a patch when I have time. I am afraid I haven’t had much time to study recently but I would like to add an update soon.

2 Likes

Thank you so much! This is the one tool I used the most. It would be nice to have it back. ありがとうございます

1 Like

Update 1.5.21 (Hotfix)

  • Hotfix to tackle UI changes
  • Add PDF links will be fixed in the future

For now the fix should work so it is working but I will need to make style changes and fix certain things in the future to make it more adaptable to website updates.

4 Likes

本当にありがとうございました!

1 Like

Update 1.6.0

  • Added button to open ChatGPT and copy a pre-made prompt to clipboard button (CAUTION: ChatGPT can be a helpful tool for language learning, but it’s important to remember that its responses may contain inaccuracies or lack context.)
  • Fixed Bunpro discussion links
  • Forced links to automatically reload when navigating through lessons using the page arrow
1 Like