Implementing a Web Worker functionality in Joplin

I saw how the OCR with Tesseract works. Correct me if I am wrong:

On the high level, the way I think it works is that it initialises the web worker which is already provided Tesseract. It waits for users to upload any resources (.jpg, .pdf, etc.). Once the resource is uploaded, the worker put its idea into the task queue. That way, the asynchrony is achieved and the OCR will perform when the queue is pulled.

I am planning to implement the general web worker that would not only work for Transformers.js but also for other future packages that are not able to load in the plugin.

  1. Is there another way we can send note content from the plugin into the web app?
  2. If there are no ways, what do you think would be the best way?
  3. Someone who implemented the OCR/Tesseract, is my understanding of the whole system correct?
1 Like

The data API allows you to create and update notes if that what you mean by "send".

Yes I think that's correct.

Please don't jump to the implementation right away, instead please write a tech spec as described there: Guide to writing a technical spec | Joplin

Because that will allow us to discuss how it should be implemented, in particular how the API to load and use a generic web worker would work

1 Like

Alright, got it!!

Here is the tech spec: Generic Web Worker in Joplin

1 Like