Create a Flex2 search plugin toolbar in Firefox2

With the release of Firefox 2.0 we had many new features and one of these is the Enhanced search capabilities:
Search term suggestions will now appear as users type in the integrated search box when using the Google, Yahoo! or Answers.com search engines. A new search engine manager makes it easier to add, remove and re-order search engines, and users will be alerted when Firefox encounters a website that offers new search engines that the user may wish to install.”

For example you can add more search engines from here. I’ve take a look at the google built-in search plugin and I managed to create a search engine for AS3/Flex2 which uses the livedocs as target result site, but which uses a “search term suggestion” too.

You can install in Firefox2 this search plugin just clicking here.
This is the XML I used to generate this search engine:

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Actionscript 3.0</os:ShortName>
<os:Description>ActionScript 3.0 search on livedocs</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///7//v///v/+/v7//v/+/v7//v/9///7/P+DZN9SLtZ4Vdv09v7////9//////77/f77//7+/v7//////v39//////7///7YzPYxA8skAMeTeeT////+/v7///z08Pve0vb//v/////9//7+/v74/fz//////v+IZuIlAMg7EM/j3vv+//3//v/9//+5p+ySdeP+/f/////+/f/8+/+TeeRtUNt0U94+D88lAsh3Ud/////9///////+/f9vSNpIG8/z7/v+/f///v/+/v6YhOUkAMgoAckyAMouAsvEtvD///z////////h2fczBc0mAMq5p+z9/////v/////u6PtCENIvAckvAcpcM9X8+////f////////+YgOYfAMgkAMtrRdv////9///9/P7///+JbN8oAckoAMqqlun//v////7///759P1MH9MiAcgvAMs2CcrVy/b9//7//v/9//7YzPY0Ac1AEtDp4Pr6//7///////+6rO4zAMwqAcgvAcomAcmLa+H///7//v///v////9fNdaDYuL+//v9//7//////v9uSN0sAMopAsovAM0vAMtEGNHw7fz////////9//6+rfDOwvT///7//v///v/Zz/M1Bs4xAcsqAMkvAco1AMwsAMqwm+r8/v7////9//7//v/////////+//3//v+OcuMqAMkyAcksAMovAMoyAMoqAMpgNtf3+v/+/f///v3//v/////////////y6vtGHtEsAMo0Ac0sAMwvAMswAM0xAsowAsrQx/L//////////v////7//////v+4oewpAMcxAM8yAMsrAcotAcoxAMw1AMwqAMyGZOH9///+//3///7///7//v/9/f1jOtktAM01AcoyAMsqAMkxAsoyAM00AMsuAcxCEtDm4vv9/////////v/////SyfQ1CM0wAMszAM4zAMwsAMo/Dc89Ds4+D889Ds43D8yqkur9//////7///////6OdeU0Dsw+D889Ds89Ds45Ds0AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//</os:Image>
<SearchForm>http://livedocs.macromedia.com/cfusion/search/index.cfm</SearchForm>
<os:Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&qu={searchTerms}"></os:Url>
<!--<os:Url type="application/x-suggestions+json" method="GET" template="http://localhost/as3-static/search.php?q={searchTerms}"></os:Url>-->
<os:Url type="text/html" method="GET" template="http://livedocs.macromedia.com/cfusion/search/index.cfm">
<os:Param name="loc" value="en_US"/>
<os:Param name="termPrefix" value="site:livedocs.macromedia.com/flex/2 "/>
<os:Param name="term" value="site:livedocs.macromedia.com/flex/2 &quot;{searchTerms}&quot;"/>
<os:Param name="area" value=""/>
<os:Param name="search_text" value="{searchTerms}"/>
<os:Param name="action" value="Search"/>
<os:Param name="client" value="firefox"/>
</os:Url>
</SearchPlugin>

You can also install it just by creating  an xml with this code and save into your:
{UserAppDataDir}\Mozilla\Firefox\Profiles\{ProfileName}\searchplugins\

Using this search plugin as it is now, it just will redirect all the queries to the http://livedocs.macromedia.com site, and uses the google suggestion search engine to display the suggestions.
See an example on how suggestions works here. As you can see the results are encoded using JSON.
This is the output you will see there: Resume For B School Admission [“mx.core.”,[“mx.core.view”]]

Business Leadership Essay But since I wanted to have a “pure” flex2 suggestion search engine I grabbed all the contents from the Flex2 Language Reference site using python, saved the results in a local Mysql database and finally created a little search engine in PHP which returns the same json-encoded results, to be used with my search plugin.

Replacing the original search plugin xml file into:

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Actionscript 3.0</os:ShortName>
<os:Description>ActionScript 3.0 search on livedocs</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///7//v///v/+/v7//v/+/v7//v/9///7/P+DZN9SLtZ4Vdv09v7////9//////77/f77//7+/v7//////v39//////7///7YzPYxA8skAMeTeeT////+/v7///z08Pve0vb//v/////9//7+/v74/fz//////v+IZuIlAMg7EM/j3vv+//3//v/9//+5p+ySdeP+/f/////+/f/8+/+TeeRtUNt0U94+D88lAsh3Ud/////9///////+/f9vSNpIG8/z7/v+/f///v/+/v6YhOUkAMgoAckyAMouAsvEtvD///z////////h2fczBc0mAMq5p+z9/////v/////u6PtCENIvAckvAcpcM9X8+////f////////+YgOYfAMgkAMtrRdv////9///9/P7///+JbN8oAckoAMqqlun//v////7///759P1MH9MiAcgvAMs2CcrVy/b9//7//v/9//7YzPY0Ac1AEtDp4Pr6//7///////+6rO4zAMwqAcgvAcomAcmLa+H///7//v///v////9fNdaDYuL+//v9//7//////v9uSN0sAMopAsovAM0vAMtEGNHw7fz////////9//6+rfDOwvT///7//v///v/Zz/M1Bs4xAcsqAMkvAco1AMwsAMqwm+r8/v7////9//7//v/////////+//3//v+OcuMqAMkyAcksAMovAMoyAMoqAMpgNtf3+v/+/f///v3//v/////////////y6vtGHtEsAMo0Ac0sAMwvAMswAM0xAsowAsrQx/L//////////v////7//////v+4oewpAMcxAM8yAMsrAcotAcoxAMw1AMwqAMyGZOH9///+//3///7///7//v/9/f1jOtktAM01AcoyAMsqAMkxAsoyAM00AMsuAcxCEtDm4vv9/////////v/////SyfQ1CM0wAMszAM4zAMwsAMo/Dc89Ds4+D889Ds43D8yqkur9//////7///////6OdeU0Dsw+D889Ds89Ds45Ds0AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//</os:Image>
<SearchForm>http://livedocs.macromedia.com/cfusion/search/index.cfm</SearchForm>
<os:Url type="application/x-suggestions+json" method="GET" template="http://localhost/as3-static/search.php?q={searchTerms}"></os:Url>
<os:Url type="text/html" method="GET" template="http://livedocs.macromedia.com/cfusion/search/index.cfm">
<os:Param name="loc" value="en_US"/>
<os:Param name="termPrefix" value="site:livedocs.macromedia.com/flex/2 "/>
<os:Param name="term" value="site:livedocs.macromedia.com/flex/2 &quot;{searchTerms}&quot;"/>
<os:Param name="area" value=""/>
<os:Param name="search_text" value="{searchTerms}"/>
<os:Param name="action" value="Search"/>
<os:Param name="client" value="firefox"/>
</os:Url>
</SearchPlugin>

now the search plugin engine will query http://localhost/as3-static/search.php?q={searchTerms} for displaying the suggestions (so you need to have a php script there which can return something).
What I did at this point is:
1. Grab the flex2 reference using this python script. This script will output a file mysql.sql.
Dissertation Editing Help Qualitative 2. Import this sql file into my Mysql database using:

mysql  flex2_reference < mysql.sql

where “flex2_reference” is a database I previously created.
http://www.polandturkey.com/?best-thesis-writing-service Best Thesis Writing Service 3. Create this php script (sorry, it’s not really a good example of php script…) and saved into my localhost at this address: http://localhost/as3-static/search.php
and I’ve got a fully ActionScript 3.0 search engine with suggestion!

Flash Switcher for OSX

After the many requests of a mac OSX version of my last Firefox plugin I finally was able to create it.
I have to say I had much more difficulties rather than the one for Windows.
For what I could understand Firefox for Windows unload the Do Paper Writing Services Really Work NPSWF32.dll once there are no pages displaying an swf. In fact (under windows) before switching plugin I have to be sure there are no pages wih an swf within, then I can clear the dll and copy the new one.

Instead Firefox for OSX  doesn’t unload the Colleges That Require Essays For Admission Flash Player.plugin even when there are no flash contents. For that reason I could not delete the current plugin file, so I decided to first move the running plugin into Trash and then copy the new one in the Internet Plug-ins folder and then ask user to restart Firefox. In this way everything seems to work clean.

Another problem is the fact there are 2 different plugin file for mac Intel and mac PPC. So I had to create 2 different .xpi installers.
Many thanks to Gabriele Farina who help me with this, I completely forgot the fact there were 2 different installer under Mac.

Here the installers (btw, I’m not 100% sure they will work.. a better test should be done):

Flash Switcher for Firefox

P.S. Another thing regarding my recent interest on Firefox plugin development.
This morning Jesse Stratford mailed me saying he wrote an article about me (yeas, about me! ooh what a great honor):
http://www.actionscript.org/../Firefox-Plugins-for-Flash-Platform-Developers/

Flash Switcher extension for Firefox

I just did this new extension (my third extension) for Mozilla firefox. I hope it can be useful for Flash developer who want to easily test their pages with different flash player versions.
The extension hasn’t been approved yet by the Mozilla developer extension team so I decided to make first a post here, also for let you to test it and also because last time they took 3 weeks before they approve an extension…

Do Research Papers Have A Thesis Statement What is this extension?
This extension comes with all the currently published flash player plugins (from the version 2 to the most recent 9,0,16) and allows you to easily switch from one plugin to another, or also to remove the currently installed plugin (maybe for testing the express install).

Global Business Plan Writers Venture Development Where I can find it?
Once installed you will find the “flash switcher” icon in the Firefox statusbar at right. Click on it and a list of available options will appear.

http://www.topdownproteomics.org/?dissertation-banking-sector Dissertation Banking Sector Can I add more flashplayer versions?
Yes, even if you should do it manually.
The extensionn folder can be found here:

C:\{userAppData}\Mozilla\Firefox\Profiles\{userProfile}\extensions\{2b5cfade-d133-429c-aea5-865911de4e1d}

Into the “ chrome\plugins” folder you will see different folder (such as 9.0 r16, 8.0 r24 etc) with a file NPSWF32.dll within.
To install a new plugin just create a new folder with the name of the player version and copy into it the NPSWF32.dll file which comes with every flash player installer.
You can find all the old flash versions here
Another way to add more versions of the player is to install the flashplayer version you want into firefox, then save it using the “save as” menu item of flash switcher.

Download and install flash switcher here.

XUL and XULRunner (co-starring flash)

Like you probably noteiced I got more and more interest in XUL and experimenting Firefox extensions in the last days.
After my first extension I decided to try something different and first I created a little (this time nothing new at all) and lightweight extension for grabbing flv videos while visiting youtube.com or video.google.com. It simply creates a statusbar icon and when there are availables flv on the page it will get active. Clicking on it let you save the current playing flv. You can also change the options and tell the extension to open the video using you favourite Video Player (Like VLC or FLVPlayer)

Install the getvideo-0.1-fx.xpi Firefox extension

When I did this extension comes also in my mind the idea of creating a simple Flash video player, just for practice. I was doing it using python/wxPython as usual.. but then I wanted to try using XUL  and package it with XULRunner (a runtime XUL runner, which runs xul applications like standalone applications).
First of all I have to say thanks to Darron Schall for his article on how-to embed swf files in xul. I was going crazy to understand all the steps for creating a valid xulrunner package..
As usual opensource sofware has bad and incomplete documentation. I need to look into one of the examples (chatzilla) to understand how it works.

Once I undertood that a new problem arise, the damn flash security sandbox error! When the xulrunner application starts it prompt also the security warning.. Oh my god!

After various attempts and after reading various articles on FlashplayerTrust I managed to solve the problem (or at least I think I’ve solved…).
In the installer a file named flvideoplayer.cfg will be copied inside the Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust direcory, and it’s content is

chrome:\\flvideoplayer\content\flvideoplayer.xul

In this way the embed swf file should has the correct permissions to communicate with the xul page using fscommand. I thought that my experiment was finished, but when I shown it to a friend he  asked me to add also the possibility to convert the .flv video into other formats (avi, mpeg, etc).
Well, fortunately there’s ffmpeg which does this job for everyone 🙂

Thus I included ffmpeg to enable video conversion. What I did it’s a runtime .bat file which wil invoke ffmpeg:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function execute_batch(bat) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
try
{
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(bat.path);
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(file);
process.run(true, {}, 0);
} catch(e)
{
alert(e);
}
}

Ok, how to install this application.
In order to run correctly this application you first have to:

  • download XULRunner (I did not included in the installer because it’s about 10Mb).
  • Once downloaded from a command prompt, run Helping A Teenager Organize His Homework xulrunner.exe –register-global (to register for all users) or Texas History Defnions Homework Help xulrunner.exe –register-user (to register for one user only).
  • To enable the flash plugin (the Firefox plugin isn’t used, so if you launch the application you won’t see the flash embed object) you have to copy:
    {programs}\Mozilla Firefox\plugins\NPSWF32.dll
    {programs}\Mozilla Firefox\plugins\flashplayer.xpt

    into your XULRunner\plugins\ folder
  • Now just download yougrab! and install it.

Install YouGrab! (sorry but currently Windows only)

My first Firefox extension! (FlashTracer)

Ok, it does nothing particular new, but it’s my first one 🙂

Community Service Scholarship Essay What it does?
If you have a flash debug player version you will see in the firefox sidebar all the swf trace output while running any of the swf in a browser window.
I have to say thanks to jayjam (Giuseppe Montemurro) who talks about the mm.cfg file yesterday at the From A to Web Adobe conference. I’d never read about this cool feature of the debug players.. and so I decided to make it as firefox extension.
I took 1 hour to make the XUL and js files, while the .xpi package was driving me crazy!.. the documentation is really terrible for my point of view.

Buy The Research Paper For Biology Download and install FlashTracer from the Firefox extension page.

UPDATE: A new flash tracer called fbtracer has been released. This new extension is integrated into Firebug. Read more here

Write My Essay Wiki P.S. If you’re running the new 9,0,28 Flash plugin probably you noticed this extension wont work anymore. Adobe changed something and the plugin doesn’t read as previously the mm.cfg file so I’m invetigating on it. In the meanwhile you should tell the extension to point to this file: Rguhs Thesis Dissertation C:\Documents and Settings\{user}\Application Data\Macromedia\Flash Player\Logs\flashlog.txt.

For mac osx it should be: username:Library:Preferences:Macromedia:Flash Player:Logs:flashlog.txt

Using this path the flash tracer works again.

For discussing about this extension please use the forum instead of the comments here 🙂

Google browser sync

I discovered today this great extension for Mozilla Firefox made by Google.

It synchronizes bookmarks, history, cookies and saved passwords continuously across your computers. It also allows you to restore open tabs and windows across different machines and browser sessions.
It allows you to select which setting to be sent using encryption (for example the saved password, even if I just use this extension only for my bookmarks).
Using firefox using different computers every day I always had the problem of bookmarks syncronization. First I used another firefox extension, but I dont remember its name, then I decided to put my bookmark.html file under a CVS repository, but now that I discovered this extension I will definitively use this one.

download the firefox extension here:
http://www.google.com/tools/firefox/browsersync

Admin Tool

Some days ago a friend of mine showed me a “strange” (this is what i was thinking looking at that) application which made a complete debug of its flash movie.
Wow, incredible easier easier and easier than the Flash builtin debugger!!
Thus I immediately downloaded it and i was surprised of the impressive work this guy made!
Reading from admin tool’s web page: The AdminTool (AT) is a “snapshot viewer” of the current state of your Flash application without impacting the performance or the file size of your application. … It Works when published in the FlashIDE, local player, web browser. This means that you can debug your application at runtime from its intended location.
Basically it works with a Flash component (an mxp extension) which resides in your swf library and open a localconnection to the main admin tool interface.
Moreover you can change in realtime every property of your running swf to see what happens with that change.
And you can execute actionscript code in runtime from the admin tool, and see that code executed in you swf!! You can see also every video and sound from the swf.
The only requirement is that swf must be compiled for AS2 only. Downloads (mxp, win exe, mac exe and help files) are availables here: http://acmewebworks.typepad.com/…/admin_tool_down.html

IDN Exploit In Firefox

I found out today there is a pretty, well very serious flaw in the various non IE browsers. Firefox is the one I am most concerned about becuase I use it constantly.
This exploit affects all browsers except IE. It has to do with the International Domain Name [IDN] support in modern browsers. The attack allows an attacker/phisher to spoof the domain/URLs of businesses.
There is a proof of concept document that will show you exactly what it can do; there is even an SSL connection that works as well, so much for a secure connection. Try it out before you apply the fix, but not in IE! There are several articles and workaround/fixes out there. I have been messing around with them all morning and here is the run down.

  1. There is a fix listed on Boing Boing. It says to type about:config in the address bar, find network.enableIDN and set it to false. This only works until you close Firefox and re-open it. Then the links at proof of concept will work again. It also broke my Macromedia News extension, don’t waste you time on this fix!
  2. Back up the compreg.dat file first, if you attempt this fix! There is another fix listed on tech.life.blogged. This one says to edit the compreg.dat file that is located in your profile directory, eg. On XP: C:\Documents and Settings\USERNAME\Application Data\Mozilla\Firefox\Profiles\default.###\ Then you open the compreg.dat file in a text editor (I strongly suggest TextPad), find and modify the @mozilla.org/network/idn-service;1,{62b778a6-bce3-456b-8c31-2865fbb68c91} line. Change the 1 to a 0 and save the file. I tried this fix and it works, but the post states it is a permanent fix and it is not. The problem is that if you install a extension the compreg.dat file is reloaded and the 1 in @mozilla.org/network/idn-service; 1,{62b778a6-bce3-456b-8c31-2865fbb68c91} line is resored and the fix is lost. You will manually have to edit compreg.dat and change the 1 to a 0.
  3. The third fix I found at mozillaZine and advises to use AdBlocker to create a filter that will block any URL that uses characters that are outside the normal ASCII range. I have highlighted the steps to follow below:
  1. If you do not have Adblocker installed go here and install it!
  2. Once it is installed, in Firefox, goto Tools, Adblock, and open Preferences
  3. Important!! On the Preferences windows select Adblock Options and select Site Blocker: Note: Site Blocking will now have a check next to it.
  4. In the New Filter input box enter the following text: /[^\x20-\xFF]/
  5. Select Add next the New Filter input box to add the rule. Note: You will receive a Warning dialog when you select Add, just select OK to apply the filter.
  6. Select Done
  7. Go to the test page and select a link. The links will be blocked and should not load. Note: They had a paypal link but have since changed it. You still can see a nice sample of the domain spoofing.

I use Firefox everyday and love every minute of it. From what I read Firefox is working on a perminant fix that will eleminate this issue. I thought I would share this and the information I found out there about it, I would hate for a reader to expose personal information or financial data by this kind of attach. I always suggest to everyone on the internet, learn security, keep up to date on the kind of attachs going on, and most importantly, protect yourself and you data!

You can find out more details about the attach from The state of homograph attacks document.

http://www.boingboing.net/2005/02/06/shmoo_group_exploit_.html