Introduction
Hello, I wanted a way to boost my Japanese studies, I was thinking of a way that gives smart subtitles no only word to word translation, at first I prototyped a small app that load video and subtitles, then it give meaning of words and some grammar, how ever this takes a lot of time to prepare content and subtitles. So I thought of a way to watch anime in browser, and leverage firefox new AI integration to give me the meaning of words in the context and grammar.
Add Prompt Shortcut to Firefox AI Integration
Firefox added new shortcut to apply prompts on selected text in version 133.
How ever there is no clear way to add a shortcut to the prompt feature, in their documentation. After playing around I was able to find a way to add a new prompt.
Open about:config
in the address bar, and search for browser.ml.chat.prompts.
to add a new one we need to add a new key, we had already 4 prompts, so to add new one we name it browser.ml.chat.prompts.5
select string, and press the +
button to add a new key.
after that we add json to the text box, the json should have label
and value
keys, the label is the name of the prompt, and the value is the prompt itself.
After adding it press the OK
button.
{"label":"Japanese breakdown", "value":"You are expert Japanese teacher and you deticated you life to teach people Japanese the correct way, and I am a new Japanese student, can you give meaning of the selected sentence, and breakdown it down to me your noob student, and highlight grammar lessons, and when it's repeated often say so, like that I can know that it's repeated a lot. Also you can know the exact anime/episode usually in title tag so you can give more meaning depending on anime events!"}
now if we go back to the page, and select some text, we can see the new prompt in the list.
after I select it, we can see it spawns inside the page, a new small sidebar with the prompt. And it start doing what we prompt it to do. Without leaving the page. We can keep watching the anime and get the meaning of the words in the context. Without leaving the page.
Conclusion
I hope this add value to your workflow, In my case it was Japanese studies, but you can be creative and having easy access to AI models can be very useful in many cases.