Call Native API from Google Chrome Extension on Mac OS X
While the last WWDC, Apple released new extension feature for their Safari web browser. The competitor Google already released Google Chrome and it also has the extension feature.
Actually I’m using Safari as a default web browser but sometimes I’m using Google Chrome. In this use case, I need to send some URL to the Safari – a default application which is defined in the preferences to open URL on Mac OS X. I googled extensions then found there are no good extension to do that. If we don’t have it, we just create it!
To do this, we need to launch application from Google Chrome but it requires to call native code which Mac OS X provides. Fortunately, Google Chrome extension has a way to run native code inside extension, making a NPAPI plugin like FlashPlayer then including it to background HTML of the extension. This article describe how to build an extension using NPAPI plugin to call native code inside it.
Getting Started
I push all source codes to my github repository so that you can download, tweak and make good things. It includes XCode project, some configurations and plugin source code, extension JavaScript and HTML code. If you already have git command, just clone whole repository from github. If not, just take it as Zip or Tar from Download Source button on github and inflate it.
% git clone git://github.com/niw/open_with_default
Temporary, Growl Plugin for Tweetie for Mac
Now, I’m using amazing awesome twitter client, Tweetie for Mac thouth, I can’t wait a growl-enabled Tweetie for Mac…!
Hacking with TweetieHack!
I made a quick hack plugin to enable Growl feature for Tweetie for Mac!
As you know, the author of Tweetie for mac said: we are planing to implement it on Tweetie.app so, It is very temporal plugin so far. Enjoy!
Update of TweetieHack
The latest TweetieHack 0.2.0 supports Tweetie 1.1 and enhances its Growl notification. It puts tweeters’ name to notification title, show up to 5 recent tweets with tweeters’ icon, etc.
As next section, enabling Growl notification is completed by Tweetie itself but I decide to update this plugin for who want to use TweetieHack like notification with Tweetie 1.1. (Update May 10, 2009)
Using OpenCV on iPhone
OpenCV is a library of computer vision developed by Intel, we can easily detect faces using this library for example. I’d note how to use it with iPhone SDK, including the building scripts and a demo application. Here I attached screen shots from the demo applications.
Support OpenCV 2.0.0 and iPhone SDK 3.x
I updated the script and made patches for OpenCV 2.0.0 and iPhone SDK 3.x! (Updated 11/15/2009)
Getting Started
All source codes and resources are opened and you can get them from my github repository. It includes pre-compiled OpenCV libraries and headers so that you can easily start to test it. If you already have git command, just clone whole repository from github. If not, just take it by zip or tar from download link on github and inflate it.
% git clone git://github.com/niw/iphone_opencv_test.git
After getting source codes, open OpenCVTest.xcodeproj with Xcode, then build it. You will get a demo application on both iPhone Simulator and iPhone device.
How to enable the popup window on UIWebView
UIWebView is most important UIKit class of iPhone SDK, as you know, it includes all methods and functions of Mobile Safari. Though, I doesn’t accept the “open new window” or “popup window” of the link.
<a href="somehere" target="_blank" />Open this link in new window</a>
If this kind of link are shown in the UIWebView and user clicks it, nothing happens. Of course UIWebView is high-abstracted class and we SDK developer can invoke only a few methods, so there is not complete but good solution for this problem. The key methods are
language:objc
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
- (void)webViewDidFinishLoad:(UIWebView *)webView
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
Zoommy, A Stylish Image Zooming JavaScript
Today, I release a new image zooming javascript “Zoommy” which already I use on this webpage. Zoommy automatically makes a normal anchor tag into a stylish, delicious and fashionable zoom interface which you can see somewhere on the web!
Zoommy is tested and works on Safari, Firefox, IE7 and IE6 on both MacOS X and Windows. Zoommy was strongy inspired from Apple webpage and FancyZoom. You can use this as an alternative of Lightbox.js!
Demo
Zoommy automatically change the next code into a delicious image link! (zoomminizing!)
<a href="http://farm4.static.flickr.com/3033/2457505175_37b8fffc2a.jpg">
<img src="http://farm4.static.flickr.com/3033/2457505175_37b8fffc2a_s.jpg" />
</a>

