How to make a site-lookup addon for Firefox? - firefox

I'd like to create an addon for Firefox that would enable me to search a particular site by selecting text on one site and choosing to search another site by selecting that option in the context menu.
I already have an extension like that in my browser - the Wikipedia Lookup extension. Basically, I want the exact same functionality but which will send the search text to a different site.
I'm completely new to Firefox addons, so can somebody tell me what's involved in this? Or point me at a site with a list of instructions to do a plugin like this? I can see examples on how to make a Hello World kind of plugin but I can't see how to extend that example into what I need. Thanks.

Have you considered opening the Wikipedia extension source and modifying the pointer from wikipedia.com to the other search site? This is assuming you're using Windows Vista or higher. The source code should be located at:
C:\Users\YourUserName\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxxxx.default\extensions\something#wikipedia.com\chrome\content
You would then have to modify the source code inside to change the pointer, and the POST variables string to match that of the site you will be using.
I hope this at least points you in the general direction!
-Alex

Related

Where is the firefox title located in the source?

This may seem like an odd question, but does anybody know where or how to locate the title in the firefox source code? like firefox.exe and the default home page source and such?
Google yielded no results, same as on the firefox page.
Looking for it manually would take a while, considering the sheer size.
The latest source code for Mozilla Firefox is nicely indexed on DXR in a searchable form (you can even use regular expressions there!).

Guide for Carrot2 in PDF

Could you please say if there is a pdf (or doc) version of the documentation? If yes, where can I find it?
If such does not exist, I guess it would be great to create such.
PDF allows reading the file in Mendeley Desktop program, underlining parts that are important for me and putting comments. THis would be a great advantage to compare with the html version of the guide.
If you're using Chrome, just go to the Carrot2 online help manual and choose "Print...". In the "Destination" box on the left-hand side change it to "Save as PDF" and click OK. This functionality is built-in to Chrome by default.
For other browsers I'm sure there are add-ins/plugins you can find or you can always use a third-party PDF driver like PrimoPDF.

In order to add new functionality to existing Firefox clients, do I need to create an extension or a plugin?

More specifically, the idea is to allow the user to open Firefox, highlight a word on a web page, right click on it, and have an additional option that, when selected, calls c++ code that does something with the input string (must call C++ code, unfortunately), and displays a dialog box showing the result.
I'm still not sure if in order to implement this functionality I need to create a Firefox plugin or an extension. Can someone point me in the right direction?
Also, if someone can show me sample code in order to get me started that would be appreciated. (XPCOM, which I'm not even sure is what I should be using, seems a bit complicated for this seemingly simple project.)
You need a regular Firefox extension. It can add an item to the context menu, NPAPI plugins cannot do this. When it is clicked it can get the selected text and send it to your binary library. The best way to call functions in this library is js-ctypes, XPCOM is not required.

how to make a slow effect for Drop down menu for websites

im using dreamweaver to make a website. im wondering how to make a drop down menu similar to the ones in http://www.evga.com/.
Viewing the source for the page shows that it is using a JavaScript based menu system that works within DL/DT/DD "lists". The JavaScript appears to require specifically classed elements to work and uses the following file: http://www.evga.com/includes/js/dropdown.js
That file doesn't have any licensing information, but a very quick search and I ran across the following page that gives some instructions for it's use: http://www.cloft.co.uk/menu%20scripts.html
As I haven't tried to use those instructions, perhaps they can assist you.

Can I get the current page sourcecode from a firefox extension?

Can this be done? How?
I want to write my own extension. Can Get the current page sorcecode in my own extension?
As Rich says, adding view-source in front of the URL will give you the current page's source code. A keyboard shortcut for this is Ctrl+U.
I want to write my own extension.
There are a number of existing Firefox extensions that fetch a page's source code and apply some action to it (colour-coding, syntax-checking, etc). Downloading them and looking at how they handle it may be a good place to start!
7 Firefox extensions to explore source code
View Formatted Source extension
If you're new to Firefox extension development, this article at Lifehacker is an excellent primer in how to start, and will give you an idea of where to look in the above linked extensions for tasks that may be similar to your own.
Sure, just add view-source: in front of the URL.
view-source:http://stackoverflow.com/posts/edit/145419
Will show the source of this page for instance - try it in the address bar.

Resources