Snippets code from my daily experience

December 10, 2011

Open and save Firebug command line text with ViewSourceWith

Filed under: firebug,viewsourcewith — dafi @ 11:11 am

I spend much time using the Firebug command line set in multiple lines view, I edit javascript code or run little not automated tests copying and pasting code to the Firebug command line window.

Copy and paste doesn’t really fits my needs, I prefer to edit javascript files from my preferred editor (i.e. KomodoEdit) than run them on Firebug especially if code consists of many lines (more than dozen) so I’ve added to Firebugย the ability to open and save files extending ViewSourceWith

Now it’s possible to open/save files directly from Firebug but the most important feature allows to open the file both on your editor and on firebug then any saving done is reloaded automatically.

A better example, you open the file ‘hello.js’ both on your editor and firebug using the new ‘Open’ button, you edit the text from your editor and save then switch to Firebug console window and immediately the text is updated with last saved version from the editor.

VSW with Firebug support isn’t officially released but if you are interested in testing it you can download ViewSourceWith 0.9a1

December 20, 2009

Contributions, now it’s my turn (Sunday Thought)

Thanks to the contribution platform available at AMO I bought one book and a couple of software licenses (not open sourced).

I can say that the AMO contribution feature is a great success for me, dozen of donors for two ‘not so famous‘ extensions like Table2Clipboard and ViewSourceWith.

Now I’ve a little budget to use to make contributions because NOW it’s my turn!

I’ll contribute to Firefox extensions without forget other open source projects especially the utilities, I love the little time saver applications ๐Ÿ˜›

I chosen low ‘Suggested Donation’ amount for my extensions but this has generated very expensive PayPal fees per transaction so I’ll make fewer contributions but all higher than 5$, I would the software authors take maximum profits from donations.

I hope in my country (Italy) PayPal made available micropayments very soon.

I would like to receive contributions also for my Komodo extensions, strangely the official dafizilla website doesn’t attract donors (I don’t like to fill it with banners and donations messages), I hope rumors about the Add-On Store will be confirmed and the store will host not only browser (i.e. Firefox) extensions and more important it will host also free/open source components.

November 8, 2009

Karmic Koala hides Firefox context menuitems icons

Filed under: bugzilla,firefox,karmic koala,ubuntu,viewsourcewith — dafi @ 11:27 am

This week I’ve received four times the same (i.e. duplicated) ViewSourceWith (VSW) bug report that sounds…

“ViewSourceWith stopped to show the icons on context menu, this regression is present on Karmic Koala (Ubuntu 9.10)”

I use Intrepid Ibex (Ubuntu 8.10) and all works fine, so I’ve burned a Karmic Koala ISO and tested it discovering the “regression” exists.

Debug -> Add logs -> Remove logs -> Clean Profile -> DOM Inspect -> MozRepl without find where the problem occurs.

Last resort -> Bugzilla -> Found!!!

The Bug 527253 unveils the mystery!

This isn’t a regression

ViewSourceWith isn’t the guilty, Firefox isn’t the guilty but… Gnome is the guilty ๐Ÿ˜›

Type the command shown below from command line and restart Firefox

gconftool-2 --type bool --set /desktop/gnome/interface/menus_have_icons true

EDIT Or use the UI to obtain same result (thanks to mzz) system -> preferences -> appearance -> interface -> show icons in menus

This worked for me and also for two bug submitters (the other two guys do not replayed to my hint)

So remember Bugzilla is your friend ๐Ÿ˜‰

November 8, 2008

Four years of ViewSourceWith: Version 0.4 released

Filed under: nsIProcess,viewsourcewith — dafi @ 11:49 am

Today I’ve released VSW 0.4, this version mainly contains bug fixes but it is the first version using the IWinProcess the nsIProcess component replacement.
I hope people using non latin charset can appreciate this little improvement.

I’ve also added SeaMonkey 2.0a1 support, this required me some time but SM2 is very cool and can’t be ignored.

Since November 2004 when VSW 0.0.1 was published many other similar extensions have been created and those extensions today are very cool and maybe VSW has arrived to the end, I’m not sure its development is still useful for the developer community.

The only feature a never seen in other extensions is the ability to edit richbox text like Gmail content messages or WordPress HTML posts but probably I missed the extensions doing it ๐Ÿ˜‰

October 8, 2008

nsIProcess, Windows and Unicode

ViewSourceWith (VSW for friends) existence was impossible without nsIProcess, VSW must run programs and pass them at least one file name.

When arguments passed to nsIProcess are ASCII strings all works like a charm but you enter the hell if strings contain Unicode characters like those contained in Cyrillic or Japanese alphabets.

nsIProcess, especially under Microsoft Windows, doesn’t work very well with UTF-8 strings (see bugs 229379, 408923, 411511).

On VSW forum an user asked to me to fix the problem but it isn’t strictly related to VSW because the problem affects the XPCOM implementation.

After many attempts I surrendered and I decided to write my Win32 (Win64??) XPCOM component.

My IWinProcess has the same nsIProcess’s method signatures (Init, Run) but accepts wstrings and calls the unicode CreateProcessW Win32 API instead of its sibling CreateProcessA.

The Javascript caller (eg VSW) must pass UTF-8 strings but this is the only constraint.
Now finally I can open local files containing Unicode characters without tweaking the Windows ‘Regional Options’.

Linux seems to work fine (at least on my Gutsy box) simply converting Unicode strings with nsIScriptableUnicodeConverter.ConvertFromUnicode, no other special workarounds.

I don’t know if MacOSX works like Linux, I’m unable to test under Apple machines.

I don’t like code containing platform checks (if Windows … else if Linux … ) but to simplify VSW development the ‘if’ statement sounds reasonable.

The IWinProcess source and DLL are present on dafizilla SVN repository.

The next VSW release (0.4) will contain the IWinProcess component

August 1, 2008

ViewSourceWith, Thunderbird and mail editing

Filed under: extension,firefox,nsIEditor,viewsourcewith,xul — dafi @ 8:25 am

ViewSourceWith (VSW for friends) is definitively a browser oriented extension, using it with Thunderbird (TB) produces a very different experience.

VSW under TB allows users to view the mail message text (for example to inspect headers) but it doesn’t support any editing feature.

Under Firefox VSW offers textbox form editing (single and multiple lines) and I use daily the feature to edit GMail message content.

Editing rich textbox like GMail is a great feature, you can edit HTML code not only plain text, this is a great step ahead.

A couple of users asked me to add to VSW the ability to edit Thunderbird messages, not the raw view but a real edit feature in mail composition.

Well, now VSW (from version 0.3) can be used to edit Thunderbird messages, both plain text and HTML messages.

Technically speaking adding TB editing was enough easy using the nsIEditor, the same component used under Firefox with GMail.

I hope to post more details about the nsIEditor usage in VSW

May 5, 2008

GIMP doesn’t reuse running instance under Windows

Filed under: gimp,gimp-remote,gimp-win-remote,viewsourcewith — dafi @ 7:44 pm

A ViewSourceWith‘s user posted an interesting question on forum: how to reuse an already running GIMP instance.

I’ve never incurred on this problem on my Linux box so I was very surprised.

Booting under Windows I’ve found this different behavior, very strange because the GIMP documentation explains how to obtain the opposite effect using command line switches, i.e. running always new instances.

IMHO the reuse technique under Windows is bugged so I found a workaround using the not so famous gimp-win-remote executable program present on bin directory.

gimp-win-remote checks (correctly) if GIMP is already running and reuse it.

I’m curious to know if Mac OS/X complains to unix world, if you have a Mac and would satisfy my curiosity I will update the ViewSourceWith FAQ page ๐Ÿ˜‰

April 5, 2008

Houston we have a problem: ViewSourceWith under FF3b5

Filed under: firefox,viewsourcewith — dafi @ 10:46 am

Bad news for ViewSourceWith and its compatibility with FF3.0.

Due to the bug “Code running in context of hiddenDOMWindow runs unprivileged?” ViewSourceWith stopped to work when FF3.0b5 was published.

I’ve done many code modifications to adhere to FF3 requirements and now VSW 0.1b is ready.
After dozen of regression tests I’m afraid something is missed so I ask to VSW users to help me to test it deeper.

Any help is welcomed not only technical tests, for example you can share my help request in other blogs/forums.
If you would help me to test VSW 0.1 download it from here.

Tests can be done on

  • Firefox from 2.0 to 3.0b5
  • SeaMonkey
  • Songbird
  • Flock

Tests must verify

  • text box editing
  • page view source
  • css/js view
  • error console view source clicking on links
  • temp files removal at application exit

Try to

  • open more that one browser window closing the openers and verify if VSW continues to work
  • use your daily VSW usage behaviour
  • use you creativity ๐Ÿ˜‰


  • Windows
  • Linux (I use Ubuntu Feisty)
  • MacOSX

Please use this post to give me feedback or better land to “ViewSourceWith Open Discussion

Create a free website or blog at