jelmervdl / translatelocally-web-ext

TranslateLocally for the Browser is a web-extension that enables client side in-page translations for web browsers.
https://addons.mozilla.org/en-GB/firefox/addon/translatelocally-for-firefox/
Mozilla Public License 2.0
65 stars 3 forks source link

Only run language detection once popup is triggered #46

Open jelmervdl opened 1 year ago

jelmervdl commented 1 year ago

Right now language detection is run for every page, regardless of whether the user is intending of using the translation add-on. We don't use this information for anything unless the user opens the translation popup.

(edit: and of course if we already enabled translating a certain domain we should not have the user click the button again!)

In the grand scheme of things I don't think it has much of an impact, but if we're looking for optimisations, this might be one.

jelmervdl commented 1 year ago

Slightly related: I was also looking into whether activeTab instead of <all_urls> would be sufficient permissions… but that would mean you would have to click the 'translate' button every time you navigate to the next page. So no, not right now.