LingQ Extension (Custom Layouts, GPT, AI-TTS, etc.)

When you move between pages in LingQ (e.g., library > lesson or editor > lesson), the page is not refreshed. So the script’s URL matching does not work. Open the lesson page in a new tab or refresh before starting the lesson. For now, it’s the only way.

1 Like

ok. thank you so much :heart:

v 5.12
Integrated the youtube player simplification script into the code (Remove the more videos pop-up and youtube logo in the player, so you can read the subtitle while the video is paused).

Before and After

Download Script


If you have a feature you want to suggest, let me know. I’ll consider that.

v 5.12.2

Enhanced the prompts (make them more compact and desirable). Fixed the wrongly calculated input tokens of Gemini chat.


Question to the user of the script

Do the dictionary and translator functions work well with your language pairs?
My setting is English-Korean (Input-Output). I have been modifying the prompts to make them work well with multi-language setups. And for now works well in my setting. Do they also work well with your pair (the output language is always displayed as you wanted)? If not, where does it not work (word/sentence and definition/translation/example sentence, etc.)? Let me know your language pair and experience.

v5.13
Added the translation text color picker to the settings page.

I figured out the translation is displayed in a weird way, and because of that, the font color setting doesn’t work for that. Also, I don’t think the main text and translation should have the same color. So, I added a color setting for translated text.

You can change the translation’s font size with the default text size controller.

Download Script

Is it possible to adjust the left and right margin? The left margin feels too close to the edge to me.

You need to change the margin values in the code manually.

Left Article margin (currently 10px)

        .loadedContent {
            padding: 0 0 0 10px !important;;
        }

Left YT video margin (currently 10px(last))

        .video-player:not(.is-minimized) > .modal-content {
            max-width: var(--width-big) !important;
            margin: 0 0 10px 10px !important;
            border-radius: 0.75rem !important;
        }

Thanks! that worked.

1 Like

v 5.14
Added an autoplay in sentence view. In the sentence view, the audio is automatically played, and translation is displayed automatically when a page is changed


Good News. I found this script also works perfectly in a mobile environment.
I haven’t optimized it for a smartphone layout yet, but if you use a tablet PC, you can use the script. For me, it’s much better than LingQ app.

Screen shots (tablet PC)

Audio layout

Video layout

Install Guide

  1. Install Firefox app
    https://play.google.com/store/apps/details?id=org.mozilla.firefox
  2. Install Tampermonkey extension from the browser Tampermonkey – Get this Extension for 🦊 Firefox Android (en-US)
  3. Install the script LingQ Addon
  4. Use LingQ with the script (If it doesn’t work, refresh the browser.

Download Script

1 Like

Hi, I have installed Tampermonkey and the userscript using the latest version of Firefox on Windows, however when I open a lesson I am not seeing any UI, so I am unsure how to begin using the addon. Is this a known issue? Or is there a shortcut I can use to open the addon?

Show me the screen grab.

Check the script is turned on.

I got it working, I’m not entirely sure how but I think it might have been something to do with not having Tampermonkey set to ‘allow’ for private windows and sites with restrictions. Either that or I’m just daft and I got it working without realising. Thanks for replying.

Great! It sometimes works after a few refreshes,

It’s been working just fine for me. Just a broken HTML word is generated before the answer. A bracket might be missing somewhere in the code.

Do you think it is possible to add a voice-chat feature within LingQ with your script? It would be nice to talk with the AI and maybe use it to generate a new lesson and such.

  1. Show me the screenshot. For me, it works well. Since AI generates full HTML, there could be glitches. Try bigger model.

  1. technically possible. However, it will require much effort. Since I’m a voluntary community developer, I don’t have much time to do.

FYI, the LingQ team is beta testing the chatbot feature (that could be imported as a lesson, and unknown/linq words are highlighted in a chat).

v 5.15
Added a vocabulary table to the print page.
You can print a lesson with an unknown lingq list.


The text looks too bland. I will make unknown words italic to highlight them later.

Download Script

v 5.15.2



You can print a lesson with LingQ highlighting.

Also, the word in the sentence is highlighted

1 Like

v 6.0

I implemented LLM response streaming to enhance the chat experience.
Now, you don’t need to wait until the model responds.

Demo

ezgif-1f72b6d6f1f04d

Installation


If it was helpful to you, you can
Buy Me A Coffee

v 6.1.0
Made LLM have a lesson summary in its context.

When you use the chat widget, the bot has the lesson summary in its memory. So it can produce more context-aware, high-quality responses.
Also, you can ask a question about the whole lesson, not the selected word or sentence.

(No setup is required; automatically applied)

Summarized Lesson


(You can find this in a F12 dev console. Do you want a button for the summary?)

Question about the Lesson.

Download Script

v6.2.0 Added a regenerate response button to the last bot message.
v6.2.1 Added a copy message button to bot messages.

This is the copying result:

different [ˈdɪfərənt] (형용사)
다른

주어진 문맥에서 'different'는 시편의 시들이 이스라엘 역사의 다양한 시기에서 유래했음을 나타냅니다. 즉, 여러 다른 시대에 걸쳐 쓰여졌다는 의미입니다.


The museum has exhibits from many different cultures.
그 박물관은 여러 다른 문화의 전시물을 가지고 있습니다.

Download Script