KoL Wiki Search

By Tom W.M. Last update Feb 29, 2008 — Installed 1,523 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 5 posts, 3 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Tom W.M. Script's Author

Minor update: changed the inclusion rules slightly.

 
Tom W.M. Script's Author

I've updated the script -- now you can shift-click on selected text to perform a search. There's also a hidden preference to switch between GM_openInTab and window.open -- visit this URL to set the preference.

 
Tom W.M. Script's Author

That?s a good idea. I think that I?d rather do it in some other way, though?GM_registerMenuCommand has always seemed somewhat usability-challenged to me (plus, there?s speculation on greasemonkey-dev about someday removing it). I?ll look into doing this on alt-click or something similar.

 
Dani Church User

This is an excellent script! Here's an addition I made which makes it even more useful:

if (window.location.pathname == '/main.html') {
  GM_registerMenuCommand("KoL Wiki search from selection", function() {
    for (var f = 0; f < window.frames.length; f++) {
      if (!window.frames[f].getSelection().isCollapsed) {
        wikiLookup(window.frames[f].getSelection().toString());
        return;
      }
    }
    window.alert("Highlight text first!");
  });
  GM_registerMenuCommand("KoL Wiki search...", function() {
    var term = window.prompt("KoL Wiki search term:");
    if (term) {
      wikiLookup(term);
    }
  });
}

Note that I've taken the original GM_openInTab() call and exported the functionality to a function called wikiLookup(), so that all three calls do the same thing. And personally, in my installation I use window.open(), since that opens in a new tab (with my FF configuration) but also automatically focuses on the new tab.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel