Drupal API Search for Firefox

Update : This works in google chrome too. Press CTRL+B to show your bookmark toolbar. then follow the steps below.

Step 1 : Right-click on the bookmark tab and create a new bookmark.

Step 2 : In the new pop up window enter "Drupal Search" as name and the javascript code below in location.

Code

javascript:(function(){var a="";if(window.getSelection){a=window.getSelection()}else{if(document.getSelection){a=document.getSelection()}else{if(document.selection){a=document.selection.createRange().text}}}var b=prompt("Search drupal.org:",a);if(b!=null){if(b.charAt(0)=='m'&&b.charAt(1)==':'){b=b.substr(2,b.length);window.location="http://drupal.org/project/"+escape(b)}else if((b.charAt(0)=='6'||b.charAt(0)=='7')&&b.charAt(1)==':'){version=b.charAt(0);b=b.substr(2,b.length);window.location="http://api.drupal.org/api/search/"+version+"/"+escape(b)}else window.location="http://drupal.org/search/apachesolr_search/"+escape(b)}})();

Next time you want to search drupal you just click on the bookmark and enter your keyword. To search the api use 6:keyword or 7:keyword. Also you can select any word on the page and click on the bookmark button to search for the selected word.

Comments

Sweet...

Very useful. best piece of code around for using the api on firefox. i've got the chrome extension too. thanks mate

Works better than the actual firefox extension

New version :

use m:modulename to navigate directly to the module page.

eg m:views will take you to the views module page.

Thanks

More functionalities. awesome. anyone tried this in opera? i think it should work in all browsers ( i dunno about IE) since this is javascript.

Add new comment