bpierre / gtranslate

Translate the selected text using Google Translate.
https://addons.mozilla.org/firefox/addon/gtranslate/
Mozilla Public License 2.0
95 stars 27 forks source link

Private mode #38

Closed bpierre closed 8 years ago

bpierre commented 9 years ago

Should gtranslate be available in private mode? It makes requests to an external service, but no cookies are sent so I guess it’s fine.

pedro22 commented 9 years ago

Now I know for 100% gTranslate 0.11.0 does not work in private mode, and version 0.10.1 works, something had changed in the last version - can you fix it?

Win XP SP3 - Firefox 38.0.1

pedro22 commented 9 years ago

@bpierre If you keep working on this that gTranslate 0.11.0 and 0.11.0.1-signed does not work in the private mode (at least for me) important to me, because very often use private mode and version 0.10.1 has a few bugs.

Firefox 38.0.5 - Win XP SP3

andrefidalgosilva commented 9 years ago

gtranslate doesn't work in Private mode on Firefox 38.0.5 over here -- it would be much appreciated if it did!

pedro22 commented 9 years ago

Will someday version gTranslate operating in private mode? if there is no chance.

Firefox 40.0.3

mote0230 commented 9 years ago

According to https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/private-browsing doesn't seem too difficult, just 1 line in package.json

mote0230 commented 9 years ago

http://b.1339.cf/xuugebe.xpi Here is the addon that should work in private mode. Bonus, look at the hover text when translating single words To sign it I had to create a new unique identifier since I don't have access to the owner's mozilla account, this will mean that if you install this one it will not overwrite your older gtranslate. (and you'll end up with 2 gtranslates until you delete one)

pedro22 commented 9 years ago

@mote0230 Thanks, but unfortunately it did not work - no corresponding field in the context menu.

mote0230 commented 9 years ago

Are you sure? It works for me, http://i.imgur.com/twknaaU.png

pedro22 commented 9 years ago

Strange in the same window (private mode), there is no field http://www.imagebam.com/image/b5d011434860286 - but in a new window is up and running http://www.imagebam.com/image/41892d434860294. So it's OK - my apologies - Thanks.

pedro22 commented 9 years ago

I checked thoroughly and the problem still exists - I downloaded a clean version of the portable and the start (private mode), there is no field in the menu, only after the new private window opens gTranslate appears on the menu - or you too so do you have?

mote0230 commented 9 years ago

I managed to replicate your issue (for those unaware, by setting the privacy option "always use private browsing mode") and I'll look into it a bit.

S3ndG commented 8 years ago

So what's new here? Will gtranslate be available with private mode support one day?

bpierre commented 8 years ago

Fixed by https://github.com/bpierre/gtranslate/commit/4412dae0673cc347bfebbb228eb9afe140f3ba5f

bpierre commented 8 years ago

Reopening, see https://github.com/bpierre/gtranslate/issues/49#issuecomment-148668923

PerfectSlayer commented 8 years ago

Okay, I saw the post @bpierre points for how to reproduce bug. I'll check this the next week and see what I can do :wink:

PerfectSlayer commented 8 years ago

The issue is Firefox-side. In "always-enabled private mode", the first browser windows is not accessible by the SDK even using private-browsing mode flag…

bpierre commented 8 years ago

Argh… is it getMostRecentBrowserWindow()?

PerfectSlayer commented 8 years ago

Currently, the high-level windows module is used. The function getMostRecentBrowserWindow() comes from the unstable low-level window/utils module. I would rather use the windows one but it seems buggy in this case. The documentation said private browsing is supported but not in this particular case.

bpierre commented 8 years ago

I opened a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1224863

PerfectSlayer commented 8 years ago

I hope they will fix it! Thanks :wink:

PerfectSlayer commented 8 years ago

Hey guys! A quick update: a user just left me the same bug on AMO. And after a quick look, I found a way to fix the SDK! :sweat_smile:

I'll post progress on the original bug report.

PerfectSlayer commented 8 years ago

The fix has been approved by Mozilla reviewers! It will be added in the next versions of Firefox (Aurora, Beta then stable) so it should be fixed for Firefox 51 :sweat_smile:

@bpierre Would you like I close the bug right now or you want to wait the official release to test?

bpierre commented 8 years ago

Awesome, thank you @PerfectSlayer! 🎉

OK to close it now, I don’t think there is anything to change on our side? We can always reopen it later.

PerfectSlayer commented 8 years ago

Nothing at all. It's in the jetpack SDK implementation shipped within Firefox. So 15 months later, I finally close the issue. :smile:

pedro22 commented 7 years ago

GTranslate 0.14.0 still does not work in the private mode, the latest version of operating in this mode is 0.9.1

Win XP Pro 32bit Firefox 50.0.1

bpierre commented 7 years ago

@pedro22 It looks like it’s a Firefox problem, but the good news is that @PerfectSlayer fixed it 🎉, and it will be available in the next version (51).

For more information, see https://github.com/bpierre/gtranslate/issues/38#issuecomment-241204838 and https://github.com/PerfectSlayer/scrollupfolder/issues/37#issuecomment-241204679.

pedro22 commented 7 years ago

OK, but if it is a problem in Firefox, why is version 0.9.1 work?

bpierre commented 7 years ago

Good question!

gtranslate 0.9.1 was developed using the XUL Overlay interface provided by Firefox to develop add-ons. Mozilla wants to move away from this interface, and provided a new one, Add-on SDK, that became the official way of building a Firefox Add-on. The reason why gtranslate 0.9.1 works is because the XUL interface (now renamed “Legacy”), while being deprecated, is still supported by the latest versions of Firefox.

Since gtranslate 0.10 (changelog), the add-on has been completely rewritten using the Add-on SDK interface, in order to be ready for the XUL support to be dropped (among other advantages, such as being compatible with Firefox in multi-process mode). The bug we are talking about exists only if an add-on uses this new interface. As “Legacy” addons are deprecated, we have no other choice than moving to it.

And it doesn’t end here: Mozilla recently implemented a new add-on format for Firefox, named WebExtensions. The reason why they are doing it is because this new format is a standard implemented by several browsers, making an add-on written in it compatible with Google Chrome, Opera, Microsoft Edge, Firefox, or any other browser that would like to add support for add-ons.

This new (-new 😄) format is going to be the only one supported in the near future: starting with the release of Firefox 53 (in about six months), it won’t be possible to submit an add-on that is not using the WebExtensions format. Starting with Firefox 57 (end of 2017), Firefox will stop loading any add-on that is not a WebExtension (including Add-on SDK addons). We obviously plan to port gtranslate to this new format, and we have an issue opened to track the progress: https://github.com/bpierre/gtranslate/issues/66.

All these changes can be confusing (and I skipped the part about the three different kinds of legacy add-ons!), but the thing to remember is that the way we write add-ons for Firefox has changed several times, and releasing the add-on using a deprecated format would just make it incompatible with Firefox in the near future, on top of removing some benefits that we have from these new formats, like the multi-process compatibility. I hope it’s a little bit clearer now!

You can find more information in these blog posts:

pedro22 commented 7 years ago

Great thanks to the gentlemen - finally gTranslate works in private mode.