You are browsing as a guest. Sign up (or log in) to start making projects!

Frictionless

  • 1 Devlogs
  • 4 Total hours
Open comments for this post

3h 33m 48s logged

After many efforts, I can OCR the image locally. (pic. 1 )

Tech choosing

Firstly, I need to find a way to help me use the npm ecosystem. So I know that I can use Vite ( because Chrome just cares about how you define config in manifest, other files are not important ). but their don’t support live-reload, which makes me feel very bad in development. I hope I can use https://crxjs.dev/guide/installation/create-crxjs/ for this.

UI and UX development

Then I think that I want to build up some menu in the extension page, which will make my extension very modern. But I think about that, if I try to translate just one image, how can the user translate just one image? Because of that, I decided to build up a context menu that allows users to choose what they want to translate and just leave the extension page there with hello text. (pic. 2 and pic. 3 )

CORS problem

Then I need to solve some problem with CORS in Chrome ( legendary web development problem ). They won’t allow me to just read the image tag, so I need to send the image URL to the background

Context problem

But background doesn’t have the context (like document.createElement or canvas, which will be able to boost my OCR speed ) which normal HTML page has, so I need to create an offscreen. Then the CORS problem comes back, and I need to build up some indexed storage solution to fix this. Thanks to Chrome.

TL;DR

And after their cors problem, isolation problem, chrome problem i here to present you the image that has the box showing you text that you see 😢😢

0
0
2

Followers

Loading…