translate.google tooltip

Translates selected text into a `tooltip' via Google translate

< 腳本translate.google tooltip的回應

提問/評論

§
發表於:2015-07-29
編輯:2015-07-29

Work perfectly on one firefox profile and not to an other ....

I don't understand why it work on one firfox profile and not to an other ...
I try too:
- change the value of greasemonkey.fileIsGreaseable to "true"
like i see in your code , without any results.

Firefox 39.0
Greasemonkey 3 (tested with 3.3. beta2 too)

before i used :
Google Translator Tooltip Expanded version1.12 without any problem..

trespassersW作者
§
發表於:2015-07-29
編輯:2015-07-29

Most likely my script is conflicting with some other add-on that intercepts Alt-Click combination.
I can't reproduce this problem on my PC; if you're interested, you may try to turn on webconsole logging:
uncomment script's line 92:

_log=console.log.bind(console);

then see
Tools → Web Developer → Web Console

trespassersW作者
§
發表於:2015-07-29
編輯:2015-07-29

well, I've reproduced it.
the bug arises when script tries to download country flag - we get internal Greasemonkey error:
Mozilla/5.0 (Windows NT 5.1; rv:39.0) Gecko/20100101 Firefox/39.0;
Greasemonkey 3.3

greasemonkey-modules/content/xmlhttprequester.js line 182:
TypeError: req.sendAsBinary is not a function

I can advice to install a previous version of GM Firefox.

§
發表於:2015-07-29

I test it at work :
It work fine...

trespassersW作者
§
發表於:2015-07-29

you may fix it by copying working script profile from ....\Firefox\Profiles\xxxx\gm_scripts\translate.google_tooltip.db. (or remove that file)

trespassersW作者
§
發表於:2015-07-29
編輯:2015-07-29

Seems fixed.
As it turned out, the 'binary:true' option in GM_xmlhttpRequest isn't needed.
PS: half day of work resulting in one commented line of code

§
發表於:2015-08-10
編輯:2015-08-10
you may fix it by copying working script profile from ....\Firefox\Profiles\xxxx\gm_scripts\translate.google_tooltip.db. (or remove that file)

i test that without success...

I test too the console (by uncomment script's line 92: ):
i don't see any significant (for me).
Just 2 ref. at the Jquery library , but different:
- v. 2.1.11 (from greasyfork in my test)
- v. 1.7.2 (for your script)
:-(

What i can test more ?
I appreciate your "alt" key function ...

trespassersW作者
§
發表於:2015-08-10

The bug we are discussing here has appeared in Fx39 for the following reason:
my script used the option binary in the GM_XmlHttpRequest call, but that option became obsolete in the latest Firefox, so the the browser produced the 'undefined function' error.
This is fixed in the current version (3.9.10 2015-07-29) of my script.

§
發表於:2015-08-10
編輯:2015-08-10

Thanks but:

....so the the browser produced the 'undefined function' error.

I don't see that in the console (maybe i don't watch at the right place):
only one thing i find:
1: tgtt. transla....user.js (line88)
The script don't work in this (wrong??) profile.

So, I suppose it's a problem in this profile...

i use greasemonkey 3.4 beta1:
I try too to downgrade greasemonkey but ....

i check on the working profile:
It use greasemonkey 3.3

I try too (infos read in your script - what's the reason of this about:config):
about:config -> greasemonkey.fileIsGreaseable <- true
No change too ...

Other test:
- Disable other scripts : No change too ...

I don't like when something work in a place and not an other:
An idea to find where i need to investigate ?

trespassersW作者
§
發表於:2015-08-10

Which version of translate.google tooltip you are using?
Is it 3.9.10?
I'd like to note that when you change the script's code on your machine, auto-updating stops working.

§
發表於:2015-08-10
編輯:2015-08-10

I use the last:
// @version 3.9.10

I had a similar problem with GoogleMonkeyR (updated by Kilvoctu) :

GoogleMonkeyR : Not working Firefox 39

Playing with a previous version of greasemonkey solve at each time the problem...
but not with your script...

trespassersW作者
§
發表於:2015-08-10
編輯:2015-08-10

merde, i cant start firefox39.03 with clean profile:firefox -p - not working anymore?
edit: got it! firefox -P
nevertheless, script keeps working.
i have no ideas at the moment..

trespassersW作者
§
發表於:2015-08-10
I had a similar problem with GoogleMonkeyR

I apologize for the self-promotion, have you tasted google-columnizer userstyle?

§
發表於:2015-08-10

Seems pretty....
But it didn't' provide auto-load more results
;-)

For your story of profile , you can test :
ProfileSwitcher

"It adds some options to launch easily other profiles and the Profile Manager."

trespassersW作者
§
發表於:2015-08-10
編輯:2015-08-10

I have a suspicion that database file containing script's data is spoiled. This file is named 'translate.google_tooltip.db' and it is located somewhere in folder
"C:\Documents and Settings\DECEMBRE\Application Data\Mozilla\Firefox\Profiles\????????\gm_scripts\".
Try to close Firefox and delete/rename this file.

...auto-load more results

Here is an article on this theme.

trespassersW作者
§
發表於:2016-03-09
編輯:2016-03-09

hi decembre,
proud to announce: i've updated my script, now you can run it thru bookmarklet:
javascript:postMessage('tgtooltip auto|fr','*')
and, by clicking on that bookmark, the text that is selected on webpage will be translated to french.
--
one nuance for Firefox users: if you spend time on Github, turn off CSP:
about:config → security.csp.enablefalse
(to make bookmarklets working on Github pages; see)

§
發表於:2016-03-12
編輯:2016-03-12

Thanks for the info.
I had bookmarked the Bookmarklet vs CSP (Bugzilla bug report) but i see some new comments in it:
Bug 866522 - Bookmarklets affected by CSP

Unfortunately, i don't understand to many about these CSP things...

I test your bookmarklet but it seems doing nothings....
:-(
Maybe an error from me, can you provide it directly ?

I test too to modify ABOUT:CONFIG.
- about:config → security.csp.enable → TRUE to FALSE:
but that affect all sites , no ?.
That's is not a problem ?

- about:config → greasemonkey.fileIsGreaseable → FALSE TO TRUE:
I found that In your script. It seems not change something.
What's the need of that ?

PS:

...auto-load more results :

The link is dead.

trespassersW作者
§
發表於:2016-03-12
Maybe an error from me, can you provide it directly ?

I don't know, I have everything working.

§
發表於:2016-03-13

That's good now :-)
It's possible to have the traduction near the selected text ?

trespassersW作者
§
發表於:2016-03-13
It's possible to have the traduction near the selected text ?

Yes, if you select text with pressed Alt .

§
發表於:2016-03-14

héhéh...

trespassersW作者
§
發表於:2016-03-14
編輯:2016-03-14

I am at a loss to explain this effect, initially it was not provided, it appears to be the result of an even number of bugs, but that's the positive result .

§
發表於:2016-03-14

That's not a problem:
Thanks !

發表回覆

登入以回復