Closed nY381v closed 5 years ago
Strange. That is what I thought also, and I wrote it :D Any chance you can record a perf profile and share the link with me?
It might be the fact that it changes the CSP for the current page if it uses CSP but that should be reallt limmited.
Here is my perf profile on my main profile https://perfht.ml/2Jw358C for me it really does not use a lot
Thank you for your reply. https://perfht.ml/31S1NLD
I disabled CSP. "curity.csp.enable":"false" "security.csp.enable":"false"
And I use the "-marionette" mode to control firefox.
Disabling CSP does not help. CSP is a way in which a server tells a browser "please run file1.js, file2.js and file3.css". The browser banns everything else, including stuff from translate.google.com :disappointed:
This is good for security but bad for me. On every page load I say: "wait browser, please allow file1.js, file2.js, file3.css aaaaaand translate.google.com"
This seems to take a bit of time :disappointed: As you can see the code that does this is non-trivial https://github.com/andreicristianpetcu/google_translate_this/blob/194e404cd6d8683140f945afa656db669cc3e0a7/scripts/background.js#L101-L149
I will investigate more when I get a bit of time.
Hmmm.... my assumption was wrong. It seems like updateMenuForDomain is causing all the fuss.
It seems to have a very small portion of the performance issue.
Check out my filter on your data. I'm looking at what the WebExtension process is doing. My extension is not doing anything in other processes. Google translate is doing some heavy work on demand in the content process but that should not be an issue since it's on demand.
Go ahead, play with the data.... maybe drill down into a specific section or period of time that I missed. https://perfht.ml/349ucyb
I created a new configuration and only loaded one extension.
Brand new profile. Your use case with different web sites. Here is the data. https://perfht.ml/36cjCIF Will try to investigate the usage of these methods. Will report back.
I have a doubt, can it be used in the form of a Tampermonkey script?
Hmmmm. I will look into this. It will not work for sure on pages with CSP 😞
I made a fix for the perf issue but I cannot ship new updates to the extension.
Thank you. Where can I find new xpi files?
I cannot ship new versions :( you have to build it yourself https://github.com/andreicristianpetcu/google_translate_this/issues/19
I will publish an unsigned xpi file once I get to my laptop but not a signed one.
Try this. It's not signed so you need to disable xpi signing. tr_desktop.zip
Thanks. But even if I disable extension verification, it still can't be installed.
Hmm. It works for me. I made a new profile in Firefox Nightly from about:profiles. I flipped the xpinstall.signatures.required
to false in about:config
then renamed tr_desktop.zip
to tr_desktop.xpi
(github does not allow xpi attachments here for some reason) and dragged the xpi on the Firefox window. Hit Ok and it worked. @LArctic
Yes, but this is only valid in the "nightly" version.
It should also work in developer edition: https://www.mozilla.org/firefox/developer/
It should work in DevEdition also which is awesome
Looking at Firefox's performance through "about:performance", I found that "Google Translate This Page" takes up a lot of performance (when loading a new page, and this page doesn't trigger it), second only to "Tampermonkey". This surprised me a lot. I always thought that "Google Translate This Page" is roughly equivalent to a "button" and does not affect the performance of the browser.
Is this reasonable?