logo

LDD Super Search GreaseMonkey Script

Yes. This post is about GreaseMonkey again. That isn't to say it's not worth reading though! While I try to blog about an even mix of the things I'm interested in and the things I think you'll be interest in I like to think it's all of it useful in some way. Whether or not you want to use GM or these scripts in particular there's something to be had from the actual code used.

Anyhow, I've written a new script and called it LDD Super Search (install). Hopefully you'll find it useful. Here's what the search results form looks like on the forums when it's installed:

screengrab

Notice how the search string remains in the search field. This is something that's bugged for ages on LDD. I've always found myself tinkering with my original search term directly in the URL! Notice also that the search field itself is bigger - another niggle of mine on LDD. These two minor improvements might seem insignificant but they alone are enough to demonstrate the power of GM scripting. Power to the people and all that.

The other change I made was to add a new icon to each column of the results table (the arrows, circled in the grab). Clicking these icons will launch the document in a new window.

The really interesting part is the code itself, which I will talk about more tomorrow.

What next? How can it really earn the name super search? Maybe we open results in new tabs or add a checkbox that makes opening the actual link in a new window optional. We could move the search box to top-middle of the page and make it a lot bigger. How about splitting the page in to two frames - one for results and one to open the actual documents in! There are almost no limits.

Yesterday it looked like it was just Julian and I who had any interest in using Greasemonkey with Domino. Now Rob "Captain Oblivious" McDonagh has joined in (both of whom I had the pleasure of meeting at LS 2004!). Hopefully more of you will join in soon.

Comments

  1. This GreaseMonkey thing is cool indeed, and I've installed both scripts. There probably will be more lotus related scripts in the future, and I've started compiling a list on my blog.

  2. Very nice. Thanks, Jake.

    The new window thing is one of my pet peeves @ LDD. I hate losing my search results (or having to reload them by going back) so I use this favelet regularly there.

    favelet

    Maybe this could be rolled in.

    Oh , the other thing I typically do when beginning a search at LDD is to adjust the URL with "&Count=-1" so that I can just see 'em all at once.

    Cheers

    ps - Gerco, I look forward to seeing your list.

  3. I've been using Julian's LDDMonkey script since I saw it on your site.

    It starts to make the forums functional. Makes them VERY functional.

    Andrew... to keep from losing your search results on the forums, just middle click each of the links you want to view and open them in a new tab on firefox. I use this extensively on both the forums and Google.

    One last thing... after all these years, I had no idea you could do a Count=-1 to show all. Incredible how simple some of these things we learn after some days are.

    • avatar
    • Jake Howlett
    • Tue 19 Apr 2005 09:09

    For those without middle buttons to click you can hold down Ctrl to open new tabs.

    Note: Count=-1 doesn't open ALL documents really. Well it does and it doesn't. It opens as many as it can, limited by the maximum number allowed, which is set in the server document. If this setting is "0" then it will be all.

  4. Nice script Jake. You asked how to open a new Tab instead a new Window. Here it is:

    function openTab(myUrl)

    {

    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

    const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1";

    const kWindowMediatorIID = Components.interfaces.nsIWindowMediator;

    const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID);

    var browserWindow = kWindowMediator.getMostRecentWindow("navigator:browser");

    var browser = browserWindow.getBrowser();

    var tab = browser.addTab(myUrl);

    browser.selectedTab = tab;

    }

    The only problem is, that the script asks you for permission to do so (see the first line) but you can "teach" the permission-window to remember your choice.

    • avatar
    • Jake Howlett
    • Tue 19 Apr 2005 09:19

    Thanks Ruediger. I don't even get asked though, I just get an error:

    Error: uncaught exception: A script from "http://www-10.lotus.com" was denied UniversalXPConnect privileges.

  5. Mmmmmh, I only tested it from "localhost" there it asked me.... So a Greasemonkey-Script runs "as if" loaded from the original site and not as a local script.

    Sorry I didn't know this.

  6. Andrew: the list is here:

    {Link}

    But it's a list with only two items :-) Hope to see more scripts in the near future! If you have any additions, please let me know and I'll update it.

    • avatar
    • SpzToid
    • Thu 28 Apr 2005 16:00

    What are the security implications behind running GreaseMonkey? it seems that with such a client-side app running 24/7, (i.e. you forget it's there) that when you come across some nefarious page, by slightly mis-typing the URL for example, well it seems like an efficient mechanism to deliver a nasty payload.

    I'd be particularly careful about running this kind of app 'in the open' within an enterprise network; at least until the security ramifications are better understood.

    Does GreaseMonkey allow any kind of write access to the disk? Could any cache files created do harm, I dunno maybe fire up a cron job or something?

    • avatar
    • Jake Howlett
    • Thu 28 Apr 2005 17:04

    I'm not sure exactly SpzToid but I think it's limited to manipulation of the DOM and maybe firing off HTTP requests here and there. The one thing that's been highlighted is that it can "easily" capture your key presses and log them on another website somewhere. Eventually it will know your password. Muhaha.

    It's like everything else on the web - they are out to get you. Be warned! It's a dangerous place!! Take care and use everything with caution. Personally I think there's more to worry about than Greasemonkey. Things like Virii and Trojans etc.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Tue 19 Apr 2005

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

Elsewhere

Here are the external links posted on the same day.

More links are available in the archive »

More Content