WebTech: Archive

Entries For April 2006

Links in a XULRunner Iframe

Thu 27th Apr 2006 19:48 BST by Andrew from Frome, U.K.

In a recent post I mentioned that the project I'm working on at work utilised XULRunner and an iframe hosting a conventional web-app inside it. I also said that there was a problem when opening links from content inside the frame but that it was possible to fix it — but I didn't say what the solution was. Well, someone googled and found that comment and emailed to ask what the solution was. For reference then to anyone else that wishes to know the solution, here's the body of the email I replied with:

My co-developer stumbled upon the solution at:

http://developer.mozilla.org/en/docs/Opening_a_Link_in_the_Default_Browser

I wrap the first script example inside a function OpenUriInDefaultBrowser() in script included in the XUL. Note that our XUL is a simple wrapper containing an iframe with a conventional web-app running inside it. We set the source of our iframe once and then set

objIFrame.contentWindow.addEventListener("load", ExtendXULFunctionsIntoIFrame, false);

where 'objIFrame' is a handle to the iframe element and 'ExtendXULFunctionsIntoIFrame' is a function in the XUL script that passes references from certain functions through the XUL-iframe boundary. One such reference in ExtendXULFunctionsIntoIFrame() is:

objIFrame.contentWindow.OpenUriInDefaultBrowser = OpenUriInDefaultBrowser;

Additionally every page viewed inside our iframe includes an onload handler that when fired enumerates all anchor elements with href attributes and appends an onclick event listener to each one. The idea is that when such a link is clicked/activated this onclick event listener intercepts the event, cancels it (invoking preventDefault() and stopPropagation()) then locates the event target node (the anchor that was clicked) pulls out its href attribute and passes its contents as a parameter into a direct call to OpenUriInDefaultBrowser(strUri).

Not elegant, but surprisingly effective!

ADSL Regrade

Wed 26th Apr 2006 19:35 BST by Andrew from Frome, U.K.

My BT exchange (Frome) was recently upgraded to allow ADSL end-users to connect at up to 8Mb/s (up from 2Mb/s), so I submitted a regrade request to F2S last week. Initial estimates indicated that I could get 5.5Mb/s max downstream, but the regrade went through today and my modem claims to be connected at the full 8Mb/s with 448b/s max upstream and I haven't noticed any instability yet.

In order to have the regrade I had to select a new ISP package and unfortunately all of these came with mandatory caps (prior to the regrade I wasn't limited). That said, F2S provide an online usage tally per month and using this I discovered that at no point since joining F2S had I exceeded even 5GB/month (including working from home), so opting for a 20GB/month transfer limit appeared to be fairly academic. The financial saving in switching to a 20GB cap has allowed me to subscribe to Amazon's “DVDs by Post” service.

So, I can download up to 4 times per month more than I have been but now at 4 times the speed (remote server willing) and essentially get to watch 3 home-delivered DVDs a month for free — nice!

Updates to Old Posts: AJAX and XULRunner

Sat 15th Apr 2006 23:50 BST by Andrew from Frome, U.K.

Here's some updates to old posts that you might otherwise miss because of the way your RSS reader works [ winking smiley ]

  • Easy Ajax With Prototype — where I re-invent a method of making accessible AJAX requests that someone already got credit for and attempt to explain how I implemented the AJAX Request configuration information inside “rel” and “accept” attributes on ordinary hyperlinks and forms respectively.
  • Mozilla's HTA — where I briefly mention how we've switched to using XULRunner as our AJAX application wrapper for our intranet environment.

The Development Abstraction Layer

Tue 11th Apr 2006 19:38 BST by Andrew from Frome, U.K.

More sanity and general ‘having a clue’ in software management by Joel Spolsky: The Development Abstraction Layer — music to one's ears (just not Dolly Parton's).

A programmer is most productive with a quiet private office, a great computer, unlimited beverages, an ambient temperature between 68 and 72 degrees (F), no glare on the screen, a chair that's so comfortable you don't feel it

Google Suggest: Employ a Competent Security Team

Mon 10th Apr 2006 08:29 BST by Andrew from Frome, U.K.

Continuing a series of finding, reporting to Google, waiting for a reply, reporting again, banging head on a wall, then giving up and publically disclosing cross-site scripting vulnerabilities in Google products: Yet More Google Security Failures.

Google's web application security track record isn't good, it's dire — these aren't difficult conceptual issues, they're basic “Security for Beginners” territory. It'd probably be more economical to employ Jim — I hear he's looking for a new place to live…

More Than Meets The Eye

Mon 3rd Apr 2006 19:27 BST by Andrew from Frome, U.K.

April 5th is Naked CSS Day.

I for one will be showing off my well-honed <body>. So how about you, or are you afraid that you're all style and no substance? Go on, show us what you're made of, lay yourself bare and prove that you're not just a pretty font-face!

[via The Web Standards Project]

271 Archived Entries by Month & Year

Search Reminder

Can't find what you're looking for? Search for it!

Blog Search