10.4: View Dashboard widgets in Safari

May 04, '05 09:58:00AM

Contributed by: David Ness

Tiger only hintWant to run a widget in a browser? You can, quite easily in fact. Open the /Library/Widgets folder, and control-click on any widget (World Clock, for instance). Select Show Package Contents from the pop-up menu to open the package. Now just double-click on the WorldClock.html file, and see the widget load right up into your browser window. The widget will have all its normal functionality, including the 'reverse-flip' when you press the 'i' button. I realize that Widget developers know this, but I thought it was cool enough to mention.

[robg adds: I believe only Safari will display the widgets properly. I tried opening World Clock in Firefox and OmniWeb (which uses a slightly older version of Apple's WebCore). Firefox showed nothing at all; OmniWeb showed the blank clock, but the arms were missing and the UI didn't function. Safari has some extensions to HTML that are required for the widgets to work -- I'm not sure if these extensions are part of Apple's open source WebCore or not. If they are, future versions of OmniWeb should be able to display the widgets.

I realize that most developers out there will be saying "duh!" about this hint, but for the casual user, this is a good way to learn a bit more about widgets -- you can view the HTML source easily in either a browser or text editor, for instance. You can also take a look at the JavaScript files to see just what goes into making a widget...]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050501002719259