木曜日, 12月 17, 2009

Chrome Extensions

Google Chrome browser seem to get the momentum now that many extensions are available.

Chrome Extensions

Sensible enough, it runs Javascript. The objects are custom made, though, and it will take time to get them all.

Google Chrome Extensions (Labs)

A code like this will set a listener. The specified callback function will be invoked when the icon is clicked.



chrome.browserAction.onClicked.addListener(function(tab) {

alert(tab.url);

});



When the extension is invoked, it creates popup window. It could create empty background window. The current selected window is called contents window and scripts and css's etc for the window can be specified in .json file.

Overview

Google Chrome 拡張機能では、それぞれ任意のページ(background), サイトを開いたときに起動する(contents), アイコンをクリックすると表示される(popup)などで指定するコードを起動できる。

PHP: 定数を扱う

プロジェクトごとの定数を扱うクラス Config\Constants の紹介です。 <?php namespace Config; class Constants {     public const DB_USER = "linguist...