Monday, July 26, 2010

Firefox extension: Invert Input version 2



Note: This is the online help of an old version. Please try the latest version.

No matter what reason you want to invert your input to the browser, you can do it with this extension now. It can invert the input of a text field or a password field.

After you input something into a text box, right click your mouse to pop up the context menu where you can see an item of "Invert Input". Click it and the text will be reversed. The background color of the text box will be changed to navy color to indicate that the text has been reversed. If you do the inverting again, the text will return to original, but the color of the font will be set to navy with a white background color. This reminds you that you have run even times of the function to make it return to original.

If you prefer keyboard shortcuts, you can use Ctrl-Shift-I to invert the input while the cursor is in that text box.


Open inverted URL

To answer the request from some users, a new option to open inverted URL is added to version 2.0. To use it, you must first enable it on the Options dialog (See the Options section). Then you can highlight the inverted URL and right-click to select "Open Inverted Link" from the context menu. The inverted URL will be opened in a new tab.
If you right-click on a link and choose "Open Inverted Link", the address of the link will also be reversed and opened in a new tab.

Download/Installation
https://addons.mozilla.org/en-US/firefox/addon/72674/


Options
By default, the text is inverted line by line if there are multiple lines. For example,
        line one
        line two
        line three

will be inverted into
        eno enil
        owt enil
        eerht enil

If you want to invert the whole thing from top to bottom without considering line breaks, you can go to the Options dialog and uncheck the option of "Invert line by line". The result will be changed into
        eerht enil
        owt enil
        eno enil


In version 2.0, a new option "Handle inverted link" is added. By checking it, you enable the "Open Inverted Link" on the context menu when you right-click a highlighted text, or when you right-click on a link. The highlighted text or the address of the link will be reversed and opened in a new tab.

Click here to see how to open the "Options" dialog.

Firefox: customize the toolbar


The steps to add, remove or arrange the buttons of the toolbar are

1. Right click on the toolbar. The context menu shows up.

2. Select "Customize..." from the context menu. A Customize Toolbar palette pops up.

3a. To add buttons to the toolbar, find the button from the palette and drag it to wherever you want inside the toolbar.

3b. To remove buttons from the toolbar, drag the button that you want to remove from the toolbar to the palette.

3c. To arrange buttons in the toolbar, drag and drop the button to a new location inside the toolbar.

Thursday, July 22, 2010

Firefox extension programming: add an icon/button to the address bar


During the development of Invert Input version 3, I tried to add an little icon to the address bar (URL bar). When the user clicked on the icon, the URL would be inverted. Although this idea was dropped, the steps of the creation of an icon in the URL bar are captured here.

1. In the overlay.xul file, added an icon to the urlbar-icons group:

   <hbox id="urlbar-icons">
      <image id="invertinput12urlbarIcon" insertbefore="star-button" src="chrome://invertinput12/skin/icon16.png" onclick="invertInput12.invertUrl();" tooltiptext="&invertInput12CM.invertUrl;" />
   </hbox>

   The icon was inserted before the "star" icon. It had the size of 16x16. When it was clicked, function invertUrl() would be invoked.

2. Function invertUrl() focused on the URL bar first. Then it called the invert() function to invert the text of the focused element.

   invertUrl : function()
   {
      document.getElementById("urlbar").focus();

      invertInput12.invert();
   },

3. We wanted to control showing/hiding the icon through the Options dialog. How to add items to the Options dialog and Firefox configuration tree is out of the topic. We just discuss how to show/hide the icon according to the configuration parameter.

   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
                       .getService(Components.interfaces.nsIPrefService);
   myprefs = prefs.getBranch("extensions.invertinput.");

   invertInput12.isShowUrlBarIcon = myprefs.getBoolPref("showUrlBarIcon");

   // The Invert Link icon on the URL bar.
   var urlBarIcon = document.getElementById("invertinput12urlbarIcon");
   if (urlBarIcon)
   {
      if (invertInput12.isShowUrlBarIcon)
         urlBarIcon.setAttribute("collapsed", false);
      else
         urlBarIcon.setAttribute("collapsed", true);
   }

This idea was dropped. I decided to use a toolbar button to invert the text of the focused element.

Firefox extension programming: build a button for the tool bar


I just finished a tool bar button for my extension Invert Input. It was not difficult and not too much code were written. But there were some pitfalls which cost me some time.

1. In the overlay.xul file, we added our tool bar button.

   <?xml-stylesheet type="text/css" href="chrome://invertinput12/skin/invertinput.css"?>

    <toolbarpalette id="BrowserToolbarPalette">
       <toolbarbutton id="invertinput12button"
          label="&invertInput12CM.invertInput;"
          tooltiptext="&invertInput12CM.invertInput;"
          oncommand="invertInput12.invert()"
          class="toolbarbutton-1"
       />
    </toolbarpalette>

   The "toolbarbutton-1" class was kind of important. Without it, the icon and text were aligned horizontally which were different from the existing buttons. I don't know why the default is not made vertically as the rest buttons.

2. In the invertinput.css file, we listed where the icons were. We needed to prepare a regular icon (24x24) and a small icon (16x16).

   #invertinput12button
   {
      list-style-image: url("chrome://invertinput12/skin/icon24.png");
   }

   toolbar[iconsize="small"] #invertinput12button
   {
      list-style-image: url("chrome://invertinput12/skin/icon16.png");
   }

3. In chrome.manifest, added this:

   style chrome://global/content/customizeToolbar.xul chrome://invertinput12/skin/invertinput.css

   Without this line, our icon did not show when it was in the palette, but it showed up when the button was added to the tool bar. It puzzled me quite sometime.

This article shows the important places to look at when you want to add your own tool bar button to Firefox. Don't just copy and paste the code. You need to make changes to those strings or file names which are specific for Invert Input.

Wednesday, July 21, 2010

Will Packed Menu (a Firefox extension) mess up your tool bar?


Packed Menu was accused of corrupting the tool bar recently. I have been running this little toy since it was developed and it works great. Don't get me wrong, I am not implying that the user's comment is nonsense. I believe our users are serious about their reviews.

But what could have caused the problems? Many people like to install several or many extensions on their browser. These extensions can intervene with each other. If an extension works perfectly on the plain Firefox without any other extensions, it could stop working when another extension breaks its working condition. Each people installs different extensions with different settings, so it is very difficult to tell what is the real root cause.

Basically if the extension works with an "extension-free" Firefox, I would consider it is good. However, I am willing to make Packed Menu more robust so that when it could avoid messing up the tool bar or menu bar.

Let me tell how Packed Menu works first. When the browser is loaded, Packed Menu add a menu item "M" to the menu bar. It then wait 2 seconds to let the browser fully load. After that, Packed Menu move the main menu under the new "M" menu.

Two places might cause some problems. First, if the user's browser has too many extensions installed, two seconds may not be enough for the loading of the browser, especially when the machine/system itself is slow. Secondly, if some other installed extensions try to move, modify or delete the main menu, they could fail because Packed Menu has moved the main menu to a new location. Or if they function first, Packed Menu could fail.

In the new release 1.2, I added some fixes.

1. Wait 2 seconds AFTER the "load" event of the browser is fired.

2. Before moving the main menu, Packed Menu will check whether the main menu is still there.

However the new release could not guarantee the problem would disappear. Because if Packed Menu is loaded first and it runs happily, some other menu-related extensions which are loaded later could fail and corrupt things when their presumed working condition has been changed by Packed Menu.

Thursday, July 8, 2010

Firefox Extension: Keylogger Beater version 2


Note: This is the online help of an old version. Please try the latest version.

If you are worried about keylogging programs in your system, you can try this extension. There are two different ways to input with this extension. With the help of Keylogger Beater, a keylogger running in the background can never capture what you have really input, and you will be more confident to do online shopping or online banking.

The input method is different from any traditional ones, so please give a little patience and read the following help carefully before jumping into it.

After you have installed the extension and restart Firefox. You can activate Keylogger Beater by pressing Ctrl-Shift-k (I just found out some other Firefox extensions may use this combination as the shortcut, if that is the case in your system, you can right-click on the input text box to activate Keylogger Beater through the context menu.) when the cursor is inside a text box and you are ready to make some input. You will see a pop-up right below the text box you are about to input into. I will call the pop-up "Virtual Keyboard" hereinafter. To hide the Virtual Keyboard, just press the ESC key.


Input Method 1: By Keyboard

You can see that each key in the Virtual Keyboard consists of two characters. e.g. [K b]. I call the first character "Real Key" (the upper and larger one) and the second one "Shadow Key" (the lower and smaller one). It is simple to use the Virtual Keyboard -- when you press the Shadow Key on your physical keyboard the Real Key is inserted to the cursor position in the text area of the browser.


For example, if the Virtual Keyboard looks like this:
   [A s] [B n] [C v] [D f] [E r] [F g] [G h] [H j] ...
and you want to input "HEAD", you hit "jrsf" on your physical keyboard. A background keylogger will capture "jrsf" as your input while your browser receives "HEAD" correctly.

The Virtual Keyboard is arranged in an alphabetical order of the Real Keys. When you have the Real Key (to input) in your mind, you can easily find the corresponding Shadow Key (to hit). Then you hit the Shadow Key on your physical keyboard to input the Real Key into your browser. The first two rows of the Virtual Keyboard are uppercase letters of the Real Keys; the 3rd and 4th rows are lowercase letters; the 5th row is numbers; and the last three rows are punctuations.

Some characters may look similar, e.g. 1 and l, 0 and O. You will not be confused with the Real Key because they are in the alphabetical order. But you might not distinguish the Shadow Keys sometimes. So I use the background color to give you a hint. If the Shadow Key is a uppercase letter, the background is green; if lowercase, the background is blue; if number, the background is yellow; and if punctuation, the background is red.


Input Method 2: By Mouse

You may want to read the first paragraph of "Input Method 1" to know the definition of "Real Key".

When your mouse hovers over a key of the Virtual Keyboard for 1 second, the "Real Key" of that key will be inserted into the text area of the browser.

Please note that clicking on the Virtual Keyboard has no effect. And I would discourage you to do that because some keyloggers tries to log the screenshot when you click your mouse. With Keylogger Beater, there is no mouse click event that can be captured by a keylogger. Keylogger Beater listens to the mouseover event from the Virtual Keyboard instead.

Download/Install

You can download and install this extension from the official Firefox Addons website: https://addons.mozilla.org/en-US/firefox/addon/161736/

Please report bugs and give suggestions on this page instead of on Firefox Addons website because I do not often go there.

Why is Keylogger Beater special?

Keylogger Beater works inside Firefox as an extension. A third party keylogger can capture the events sent from the input devices to an application, but it can not capture anything happens inside an application. If you run Keylogger Beater, a keylogger can only record random inputs of Shadow Keys (from the keyboard to Keylogger Beater), but can not discover what the Real Keys (from Keylogger Beater to the browser) are.

It may be a little bit difficult to use in the beginning. With a little practice, you will find it much easier than texting with a cell phone. :)

Certainly, you will want to review the source code to make sure Keylogger Beater itself is not a spyware. You can do so online at the download site. Just login there to view them.

Context Menu

Besides Ctrl-Shift-k, you can also activate Keylogger Beater via the context menu.

Right click on a text area or a password box and you can find a new menu item "Keylogger Beater". Click on it to turn on the Virtual Keyboard and start your private input.




Options

There are some options you can set to change how Keylogger Beater works. You can open the Options dialog via the menu Tools|Add-ons



Use mouse to input

By default, this option is on. If you uncheck it, hovering the mouse over the Virtual Keyboard will not trigger the input of keys. You then can only use the Shadow Keys to input.

Use keyboard to input

By default, this option is on. You can hit the Shadow Key to input the Real Key. If you uncheck it, you enter the "mouse only mode" which is described next.

Mouse only mode

If you uncheck "Use keyboard to input" option, the "Shadow Key to Real Key" mapping function is disable. That means you should only use the mouse on the Virtual Keyboard, because whatever you hit on the physical keyboard will be entered into the browser intact -- they can be captured by a keylogger. And the Virtual Keyboard will only show the Real Keys because there would be no Shadow Keys. The Virtual Keyboard will be in black and white.


If you use the computer at home and do not worry about peeking over the shoulder, you can use only the mouse with the Virtual Keyboard. Turning the "Use keyboard to input" option off gives you a clean Virtual Keyboard.

Alphanumeric characters only

By default, this option is off. Some people may find that the Virtual Keyboard have too many keys, and it is difficult to find a specific punctuation key because they are in no official order. You can check this option to make the Virtual Keyboard contains alphanumeric characters only. That does not mean you can not input a punctuation mark. It just means a punctuation will be input directly from the physical keyboard to the browser without being encoded/decoded by the Virtual Keyboard. It is less secure because a keylogger can capture it.


Colorful virtual keyboard

By default, this option is on. The color of a key in the Virtual Keyboard is determined by the Shadow Key. If a Shadow Key is an uppercase letter, the color is green; if lowercase, it is blue; if number, it is yellow; and if punctuation, it is red.

If you uncheck this option, they are all in black and white.

As we state in the earlier section, if you uncheck "Use keyboard to input", this option has no effect and the keys are all in black and white because there are no Shadow Keys.

Rearrange Virtual Keyboard

Each time you press the shortcut key of Keylogger Beater, the Virtual Keyboard will be re-arranged. So you do not need to worry that a keylogger could steal the mapping rule of the Virtual Keyboard.

Wednesday, July 7, 2010

Firefox Extension: Invert Input version 1.x


Note: This is the online help of an old version. Please try the latest version.

No matter what reason you want to invert your input to the browser, you can do it with this extension now. It can invert the input of a text field or a password field.

After you input something into a text box, right click your mouse to pop up the context menu where you can see an item of "Invert Input". Click it and the text will be reversed. The background color of the text box will be changed to navy color to indicate that the text has been reversed. If you do the inverting again, the text will return to original, but the color of the font will be set to navy with a white background color. This reminds you that you have run even times of the function to make it return to original.

If you prefer keyboard shortcuts, you can use Ctrl-Shift-I to invert the input while the cursor is in that text box.


Download/Installation
https://addons.mozilla.org/en-US/firefox/addon/72674/


Options
By default, the text is inverted line by line if there are multiple lines. For example,
        line one
        line two
        line three

will be inverted into
        eno enil
        owt enil
        eerht enil

If you want to invert the whole thing from top to bottom without considering line breaks, you can go to the Options dialog and uncheck the option of "Invert line by line". The result will be changed into
        eerht enil
        owt enil
        eno enil

Click here to see how to open the "Options" dialog.

A scary day -- the rescue of my VirtualBox image file after upgrading Ubuntu


I was using Ubuntu Hardy Heron (8.04LTS) as a guest OS on VirtualBox. The system worked excellent, but it was about time to say goodbye and upgrade it to the latest Long Term Support version Lucid Lynx (10.04LTS).

I brought up a terminal, and run the command,
  sudo update-manager --proposed

Now you see, I made a big mistake -- I had not backup-ed my data! Well, it is very easy to backup the whole Vbox image if there is enough space in the harddisk -- just make a copy of the vdi image file.

The upgrade went smoothly till it asked for a reboot. The system hung on the reboot. The icon of the virtual harddisk was not even flashing. I powered it off and restarted it. Hung again! I tried several times and even the Recovery mode. No luck! Then I realized I was going to lose several days work on it and started to panic... I told myself to calm down and leave the desk. After I came back with a cup of coffee, I knew what to do next.

VirtualBox lets us to mount an iso image as a CDROM and change the boot order so that we could boot from the CDROM. After that, we could mount the virtual harddisk and copy the data out. A lesson had been learned this day, so I made a whole image copy before I proceeded.

While I was copying the vdi image, a new thought hit me. The version of VirtualBox I used was very old, 2.2. Was it because that this aged VirtualBox could not support the latest version of Ubuntu?

So I decided to try the latest version (3.2.6) of VirtualBox first. Downloaded... Installed... Ran... It seemed that the system was hanging again during the restart. But this time, the icon of the virtual harddisk was flashing! Oh, it was just slow, too slow to me.

After a long wait, the system was up and running again! After the upgrade of VirtualBox, we need reinstall the Vbox Guest Addition. But that was trivial to me, being so delighted.

Sunday, July 4, 2010

Install a Firefox extension for a newer/unsupported version of Firefox


Some Firefox extensions are released on this site. They are free and can be downloaded from the official Mozilla Add-ons website. I would try my best to update them as soon as possible for the latest stable version of Firefox. Some users love these extensions and want to know whether I can upgrade them for the upcoming preview version of Firefox. I do not have a plan to do that yet, but that does not mean you cannot try my extensions in the newer Firefox. In most of the cases, you can do it yourself by following the tip below. It is very simple.

   1. On Firefox Add-ons website, go to the description page of the extension you want. If the extension is not for your Firefox version, the "Add to Firefox" button is gray instead of green.

   2.  Right click the "Add to Firefox" button, and select "Save Link As ..." from the context menu. Save the xxx.xpi file to your harddisk.

   3. Unzip the xxx.xpi file with a Zip application, such as WinZip, WinRar, 7-Zip.

   4. Among the extracted files, look for a file name install.rdf. Open it with a text editor. Search for the tag "em:maxVersion" in the file. (The file is not big. You can usually just scroll down a little bit to see it.)

   5. Change the value of "em:maxVersion" to the version of your Firefox. For example, you may see the original value is "3.6.*", and you can change it to "3.7a5pre" to enable it for the preview of Firefox 3.7.

   6. Pack the the files back with the changed install.rdf by the Zip application you use. The zipped file may be named as xxx2.zip. Rename it to xxx2.xpi.

   7. Run your Firefox. Click menu "File|Open File..." and open xxx2.xpi. Firefox will ask whether to install this extension you built. Answer yes to install it.

You may also try to change the "em:minVersion" tag in the install.rdf file to support an earlier Firefox version, e.g. from "3.0" to "2.0". But I believe most of the time a new extension does not support the old Firefox.
 
Get This <