Do It Yourself CMS » Blog » General tutorials


My first plug-in for firefox: Twitter Right-To-Left

  By: admin   tags Date Added: Thursday 24-02-2011 12:59 am | Readers: 3593 | Comments: 11


In the last couple of weeks I was busy reading about how to create a plug-in for Firefox. My intention was to create a plug-in that manipulates pages in a certain way to improve their look or add extra functionality. Then I came across Greasemonkey plug-in.

Greasemonkey plug-in allows you to write a JavaScript file and load it into the plug-in. The script file is specific to a certain website and adds modifications or improves the feel and look of that website.

So I started writing my plug-in for Firefox. Twitter is on the most popular social websites. Its users are from all over the world; however it provides limited user interface languages. The list provided does not include Arabic neither any Right-To-Left languages such Persian and Hebrew. My idea was to design the plug-in so I can modify the interface of twitter to shift the page direction from Left-To-Right to Right-To-Left and translates twitter page into Arabic.

Look at this example:



I finished the script but I did not like the idea of adding a file to the Greasemonkey plug-in since it is a hassle enough for the End-user to add a plug-in to the browser and set its configurations. Luckily I came across Greasemonkey compiler. The complier takes the "user script" (Greasemonkey term for the JS file) and converts it into a Firefox plug-in and Voila the plug-in is ready for Firefox.

You can download it through this link:
https://addons.mozilla.org/en-US/firefox/addon/twitterrtl/

The plug-in is compatible with Firefox versions: 3.0 to 4 beta.

Note: I am interested in translations into Persian and Hebrew so if you are capable of that please contact me on: info@diy-cms.com

You can follow me on twitter on this account:
http://twitter.com/khr2003

And you can get the latest DiY-CMS news on:
http://twitter.com/diycms


Tags: firefox-plugin, twitter, right-to-left,

Please Provide Grease Monkey Script
Hi,

Great job on the plugin. I love how the English parts and the Arabic parts are each properly aligned.

Would you please provide the grease monkey version for those of us who don't use firefox (I use chrome.)

Thanks again.

Yousef

@u51f


Hi

Thank you.

Google integrated Greasemonkey script into their browser (or they have a similar function). They call it content scripts, check out this link to learn more:

http://code.google.com/chrome/extensions/content_scripts.html

It is even better than Greasemonkey in the sense that it applies the concept of isolated worlds. So if your are using a JS library different to the one in the website the script is applied to; they would not clash.