Ademking / BetterViewer

a replacement for the image viewing mode built into Firefox and Chrome-based web browsers.
MIT License
247 stars 19 forks source link

Firefox port and other small suggestions #11

Closed Jeusto closed 2 years ago

Jeusto commented 2 years ago

Hey, I don't know if you've looked into porting the extension to Firefox but I've tried a few things and here's what I've noticed: The extension mostly seems compatible with both browsers since Firefox supports "browser." namespace for APIs as well as "chrome.\".
The first problem is Firefox requires an addon id in the "manifest.json" in order to use "storage.sync". This can simply be fixed by adding something like :

"browser_specific_settings": {
  "gecko": {
    "id": "51846946-47ad-4ea1-bac3-ed242f738cf1",
  }

This throws a warning called "unrecognized manifest key" in Chrome, it's just a warning so not a big deal but can be fixed by having separate "manifest.json" files for both browsers.

The second main problem is "Crop image" and "Extract text" are not working, here's how it looks like. They both use "cropper.js" I believe, so that might be where the problem comes from ?

Screenshot-2022-01-25-16-59

I have other small suggestions like for example: moving the windows or toasters at the top by default because when the browser window is not wide enough, they tend to overlap with the toolbar which can be annoying but these are small changes so I can make a pull request if you're interested :

Screenshot-2022-01-25-17-12

Ademking commented 2 years ago

Hello @Jeusto, Sorry for the late reply! and thank you so much for your suggestions!

It's working now on Firefox 🔥 🦊 I've fixed the crop problem (I've changed "croppr.js" library) And I've added some customization like toast position, toolbar position, persistent theme, etc...

image

image

image

Thank you so much!

Jeusto commented 2 years ago

Thanks a lot, and great job on the update!

Ademking commented 2 years ago

🔥🦊 : https://addons.mozilla.org/en-US/firefox/addon/betterviewer