Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install
Dict
Find the meaning of any word on a
|
|
Nice work! I love how it displays the definition in a tooltip. It saves the hassle of checking a word by opening a new window or tab. |
|
|
Hi: Due to the bug of greasemonkey, it has been introduced the key word "unsafeWindow" for refering to the "window". On the lasts versions of greasemonkey this script doesn't work. I have made a few changes to make it work. I paste the script: // ==UserScript==
/*
unsafeWindow.dict = function(e) {
parse = function(text, x, y) {
for (var i=0; i<text_arr> var arr = reg_exp.exec(text_arr[i]); if (arr) { meaning = arr[1].replace(/color=green/, ''); show_meaning(meaning, x, y); break; } } } show_meaning = function(meaning, x, y) {
MyGM_xmlhttpRequest = function(url, x, y) {
unsafeWindow.document.addEventListener("dblclick", unsafeWindow.dict, true); |
|
|
Is it possible to change the event instead of double clicking to ctrl-double click. I sometimes use double-clk to select a word quickly which I don't want its definition.
|
|
|
Perfect! Thanks, Rick! |
|
|
This line will modify the script to do what you guys want. Add it at the bottom of the script: window.addEventListener("click", function() { var div = document.getElementById('GmDict'); div && div.setAttribute( "style", "display: none;" ); }, true); |
|
|
I'd like to second Alec's request. This is a really nice extension, but it'd be more usable, if a simple click elsewhere on the page would make the definition disappear. Other than that, though, it's great! |
|
|
It would be "nice" if a single or double-click elsewhere in the page would close the popup (or provide and [x] to close the popup. Currently you have to dbl-click on word in the margin to get it out of the way. |
You could comment on this script if you were logged in.
