Closed kevinulrich closed 2 years ago
Looks like too much for this small extension. Maybe I can create separated extension with this functional
How about I remove the tab translation alltogether and we could make this PR the "api key only" variant while keeping the existing extension as it is?
Hi,
this PR implements a popup-based translation that will not lose page context as mentioned in #17. I have not implemented it directly in DOM as that would need further permissions that I personally would not feel comfortable giving to a translation extension. This thus uses the WebExtension Popup-API that will open a small window to the top right of your browser.
Unfortunately, since we need the DeepL API for this task users will need to get their own API key. Getting it however is free and very easy to attain. I have included instructions in the extension settings.
I have also added an option to choose between the existing way of opening a new tab and the new way of using the popup.
Overall, this has changed a lot and I didn't expect this to result in such a large refactor so please take your time in reviewing this. I've commented everything that's not immediately obvious so you can follow the changes I've made.