8. hack: exetension.getPopupPage()
(function () {
this.getPopupPage = function() {
return this.findWindowByPathname('/popup.html');
}
this.findWindowByPathname = function(pathname) {
var views = this.getViews();
for (var i=0, len=views.length; i<len; i++) {
var w = views[i];
if (w.location.pathname == pathname) {
return w;
}
}
}
}).apply(chrome.extension,[]);
j.mp/crxgcaltoday @makoto_kw
9. Conclusion
popup
background
other -> background
getBackgroundPage()
background -> other
sendRequest()/onRequestListener()
j.mp/crxgcaltoday @makoto_kw
10. Reference
Example Code:
http://github.com/makotokw/crxjptalk_20100409
Google Calendar for Today:
http://j.mp/crxgcaltoday
Open Source of Google Calendar for Today:
http://github.com/makotokw/google-calendar-for-today
My Google Calendar (Yahoo! Widget)
http://widgets.yahoo.com/widgets/my-google-calendar
j.mp/crxgcaltoday @makoto_kw