Thursday, August 28, 2008

Accessing Secured Web Content and Web Methods

Some interesting tales, or rather, blog posts, from the dark side of web programming today.

The first and less sinister of the two, talks about accessing server side ASP.NET AJAX PageMethods from the client side, while the second one talks about accessing secured client side web pages from the server side. Follow? (The second article even utilizes an example that violates LinkedIn's user agreement.)

The scraping article, the second one, shows you how to do it by using a simple C# program to make HttpWebRequests with authentication data programmatically embedded in a cookie. You'll need to first get this cookie by signing into the website legit on your browser and then sniff it out with a tool like Firebug (which incidentally, having recently been updated, means you need to check this awesome tool out now).

From the first article, you'll learn how to access PageMethods using JavaScript. Which is a pretty innocent and useful thing to do. I'm just wondering if coupling this with JSON style script tag requests will let you circumvent AJAX's cross-domain restrictions on PageMethods, the same way it does for ASMX web services. Anyway, some ways you migth be able do this easily, with jQuery. Update: read more about ASP.NET security with JSON.

Saturday, August 23, 2008

Your Browser 6 x Faster - Take TraceMonkey for A Spin

John Resig hands you the keys:

If you want to try these out for yourself, just snag a nightly of Firefox 3.1, open about:config, and set the following preference to true:

javascript.options.jit.content

You should be, happily, in just-in-time tracing land. It's still buggy (hence the reason for hiding behind the preference wall) but it should be good enough to handle most web sites.
More on this:
TraceMonkey: JavaScript Lightspeed
The birth of a faster monkey

Friday, August 22, 2008

Gears 0.4, with Geolocation

Gears 0.4 is released, and with geolocation support for these devices (via cell ID) using Windows Mobile (5 or higher) pocket IE 4.01 upwards:

* HP IPAQ hw6900
* HTC 4350
* HTC 8525
* HTC Atlas
* HTC P3300
* HTC P3450
* HTC P3600
* HTC P3650
* HTC Touch (not supported on some devices)
* HTC Touch Dual
* HTC Touch Diamond (only works in IE Mobile)
* HTC TyTN
* HTC TyTN II
* o2 XDA Orbit
* Palm Treo 750
* Samsung Blackjack II
* Samsung i780
* SCH i760

Looks like it's going to be a busy weekend for me now :D

Wednesday, August 20, 2008

Testing Your Web App for Different Browsers

I recently did some front-end interface work. Using YUI helped me get the work done fast, and with only some minor frustrations. Until I received reports of layout inconsistencies in older versions of IE and Firefox. (Haven't tested with Opera or Safari yet.)

I thought using a modern CSS framework like YUI's would have eliminated these difficulties from the yesteryear. Unfortunately, I must have been doing some things rather unconventionally or against best practices. Maybe I should have started with Dreamweaver.

No matter, the milk is spilt. So to help me thoroughly test and make the site work on different browser platforms, I found these links helpful:

Install multiple versions of IE on your PC, and, Taming Your Multiple IE Standalones, articles I came to via PPK's Multiple Explorers. You can get standalone versions of IE from here too. Microsoft recommends testing within a Virtual PC, you can find the VPC images here (with IE8!)

Also, Legacy Versions of Firefox, which links to the portable editions of the Mozilla browser.

These are great because you can install them (both the Firefox and the IE versions) without messing up your computer. Just need to also test with Opera, and Safari, and I'm all done!

Tuesday, August 19, 2008

Links: JavaScript Dev and a Ruby-to-JS Tool

Firebug on browsers other than Firefox? Use Firebug Lite. Also, quick scripts to view generated source and stacktrace.

Red - Ruby to Javascript translator