fuelApplication.js
Go to the documentation of this file.
1 /* ***** BEGIN LICENSE BLOCK *****
2  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  *
4  * The contents of this file are subject to the Mozilla Public License Version
5  * 1.1 (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS" basis,
10  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11  * for the specific language governing rights and limitations under the
12  * License.
13  *
14  * The Original Code is FUEL.
15  *
16  * The Initial Developer of the Original Code is Mozilla Corporation.
17  * Portions created by the Initial Developer are Copyright (C) 2006
18  * the Initial Developer. All Rights Reserved.
19  *
20  * Contributor(s):
21  * Mark Finkle <mfinkle@mozilla.com> (Original Author)
22  * John Resig <jresig@mozilla.com> (Original Author)
23  *
24  * Alternatively, the contents of this file may be used under the terms of
25  * either the GNU General Public License Version 2 or later (the "GPL"), or
26  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27  * in which case the provisions of the GPL or the LGPL are applicable instead
28  * of those above. If you wish to allow use of your version of this file only
29  * under the terms of either the GPL or the LGPL, and not to allow others to
30  * use your version of this file under the terms of the MPL, indicate your
31  * decision by deleting the provisions above and replace them with the notice
32  * and other provisions required by the GPL or the LGPL. If you do not delete
33  * the provisions above, a recipient may use your version of this file under
34  * the terms of any one of the MPL, the GPL or the LGPL.
35  *
36  * ***** END LICENSE BLOCK ***** */
37 
38 const Ci = Components.interfaces;
39 const Cc = Components.classes;
40 
41 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
42 
43 //=================================================
44 // Singleton that holds services and utilities
45 var Utilities = {
46  _bookmarks : null,
47  get bookmarks() {
48  if (!this._bookmarks) {
49  this._bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
50  getService(Ci.nsINavBookmarksService);
51  }
52  return this._bookmarks;
53  },
54 
55  _livemarks : null,
56  get livemarks() {
57  if (!this._livemarks) {
58  this._livemarks = Cc["@mozilla.org/browser/livemark-service;2"].
59  getService(Ci.nsILivemarkService);
60  }
61  return this._livemarks;
62  },
63 
64  _annotations : null,
65  get annotations() {
66  if (!this._annotations) {
67  this._annotations = Cc["@mozilla.org/browser/annotation-service;1"].
68  getService(Ci.nsIAnnotationService);
69  }
70  return this._annotations;
71  },
72 
73  _history : null,
74  get history() {
75  if (!this._history) {
76  this._history = Cc["@mozilla.org/browser/nav-history-service;1"].
77  getService(Ci.nsINavHistoryService);
78  }
79  return this._history;
80  },
81 
82  _windowMediator : null,
83  get windowMediator() {
84  if (!this._windowMediator) {
85  this._windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"].
86  getService(Ci.nsIWindowMediator);
87  }
88  return this._windowMediator;
89  },
90 
91  makeURI : function(aSpec) {
92  if (!aSpec)
93  return null;
94  var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
95  return ios.newURI(aSpec, null, null);
96  },
97 
98  free : function() {
99  this._bookmarks = null;
100  this._livemarks = null;
101  this._annotations = null;
102  this._history = null;
103  this._windowMediator = null;
104  }
105 };
106 
107 
108 //=================================================
109 // Window implementation
110 function Window(aWindow) {
111  this._window = aWindow;
112  this._tabbrowser = aWindow.getBrowser();
113  this._events = new Events();
114  this._cleanup = {};
115 
116  this._watch("TabOpen");
117  this._watch("TabMove");
118  this._watch("TabClose");
119  this._watch("TabSelect");
120 
121  var self = this;
122  gShutdown.push(function() { self._shutdown(); });
123 }
124 
125 Window.prototype = {
126  get events() {
127  return this._events;
128  },
129 
130  /*
131  * Helper used to setup event handlers on the XBL element. Note that the events
132  * are actually dispatched to tabs, so we capture them.
133  */
134  _watch : function win_watch(aType) {
135  var self = this;
136  this._tabbrowser.addEventListener(aType,
137  this._cleanup[aType] = function(e){ self._event(e); },
138  true);
139  },
140 
141  /*
142  * Helper event callback used to redirect events made on the XBL element
143  */
144  _event : function win_event(aEvent) {
145  this._events.dispatch(aEvent.type, new BrowserTab(this, aEvent.originalTarget.linkedBrowser));
146  },
147  get tabs() {
148  var tabs = [];
149  var browsers = this._tabbrowser.browsers;
150  for (var i=0; i<browsers.length; i++)
151  tabs.push(new BrowserTab(this, browsers[i]));
152  return tabs;
153  },
154  get activeTab() {
155  return new BrowserTab(this, this._tabbrowser.selectedBrowser);
156  },
157  open : function win_open(aURI) {
158  return new BrowserTab(this, this._tabbrowser.addTab(aURI.spec).linkedBrowser);
159  },
160  _shutdown : function win_shutdown() {
161  for (var type in this._cleanup)
162  this._tabbrowser.removeEventListener(type, this._cleanup[type], true);
163  this._cleanup = null;
164 
165  this._window = null;
166  this._tabbrowser = null;
167  this._events = null;
168  },
169 
170  QueryInterface : XPCOMUtils.generateQI([Ci.fuelIWindow])
171 };
172 
173 //=================================================
174 // BrowserTab implementation
175 function BrowserTab(aFUELWindow, aBrowser) {
176  this._window = aFUELWindow;
177  this._tabbrowser = aFUELWindow._tabbrowser;
178  this._browser = aBrowser;
179  this._events = new Events();
180  this._cleanup = {};
181 
182  this._watch("load");
183 
184  var self = this;
185  gShutdown.push(function() { self._shutdown(); });
186 }
187 
188 BrowserTab.prototype = {
189  get uri() {
190  return this._browser.currentURI;
191  },
192 
193  get index() {
194  var tabs = this._tabbrowser.mTabs;
195  for (var i=0; i<tabs.length; i++) {
196  if (tabs[i].linkedBrowser == this._browser)
197  return i;
198  }
199  return -1;
200  },
201 
202  get events() {
203  return this._events;
204  },
205 
206  get window() {
207  return this._window;
208  },
209 
210  get document() {
211  return this._browser.contentDocument;
212  },
213 
214  /*
215  * Helper used to setup event handlers on the XBL element
216  */
217  _watch : function bt_watch(aType) {
218  var self = this;
219  this._browser.addEventListener(aType,
220  this._cleanup[aType] = function(e){ self._event(e); },
221  true);
222  },
223 
224  /*
225  * Helper event callback used to redirect events made on the XBL element
226  */
227  _event : function bt_event(aEvent) {
228  if (aEvent.type == "load") {
229  if (!(aEvent.originalTarget instanceof Ci.nsIDOMDocument))
230  return;
231 
232  if (aEvent.originalTarget.defaultView instanceof Ci.nsIDOMWindowInternal &&
233  aEvent.originalTarget.defaultView.frameElement)
234  return;
235  }
236  this._events.dispatch(aEvent.type, this);
237  },
238  /*
239  * Helper used to determine the index offset of the browsertab
240  */
241  _getTab : function bt_gettab() {
242  var tabs = this._tabbrowser.mTabs;
243  return tabs[this.index] || null;
244  },
245 
246  load : function bt_load(aURI) {
247  this._browser.loadURI(aURI.spec, null, null);
248  },
249 
250  focus : function bt_focus() {
251  this._tabbrowser.selectedTab = this._getTab();
252  this._tabbrowser.focus();
253  },
254 
255  close : function bt_close() {
256  this._tabbrowser.removeTab(this._getTab());
257  },
258 
259  moveBefore : function bt_movebefore(aBefore) {
260  this._tabbrowser.moveTabTo(this._getTab(), aBefore.index);
261  },
262 
263  moveToEnd : function bt_moveend() {
264  this._tabbrowser.moveTabTo(this._getTab(), this._tabbrowser.browsers.length);
265  },
266 
267  _shutdown : function bt_shutdown() {
268  for (var type in this._cleanup)
269  this._browser.removeEventListener(type, this._cleanup[type], true);
270  this._cleanup = null;
271 
272  this._window = null;
273  this._tabbrowser = null;
274  this._browser = null;
275  this._events = null;
276  },
277 
278  QueryInterface : XPCOMUtils.generateQI([Ci.fuelIBrowserTab])
279 };
280 
281 
282 //=================================================
283 // Annotations implementation
284 function Annotations(aId) {
285  this._id = aId;
286 }
287 
288 Annotations.prototype = {
289  get names() {
290  return Utilities.annotations.getItemAnnotationNames(this._id, {});
291  },
292 
293  has : function ann_has(aName) {
294  return Utilities.annotations.itemHasAnnotation(this._id, aName);
295  },
296 
297  get : function(aName) {
298  if (this.has(aName))
299  return Utilities.annotations.getItemAnnotation(this._id, aName);
300  return null;
301  },
302 
303  set : function(aName, aValue, aExpiration) {
304  Utilities.annotations.setItemAnnotation(this._id, aName, aValue, 0, aExpiration);
305  },
306 
307  remove : function ann_remove(aName) {
308  if (aName)
309  Utilities.annotations.removeItemAnnotation(this._id, aName);
310  },
311 
312  QueryInterface : XPCOMUtils.generateQI([Ci.fuelIAnnotations])
313 };
314 
315 
316 //=================================================
317 // Bookmark implementation
318 function Bookmark(aId, aParent, aType) {
319  this._id = aId;
320  this._parent = aParent;
321  this._type = aType || "bookmark";
322  this._annotations = new Annotations(this._id);
323  this._events = new Events();
324 
325  Utilities.bookmarks.addObserver(this, false);
326 
327  var self = this;
328  gShutdown.push(function() { self._shutdown(); });
329 }
330 
331 Bookmark.prototype = {
332  _shutdown : function bm_shutdown() {
333  this._annotations = null;
334  this._events = null;
335 
336  Utilities.bookmarks.removeObserver(this);
337  },
338 
339  get id() {
340  return this._id;
341  },
342 
343  get title() {
344  return Utilities.bookmarks.getItemTitle(this._id);
345  },
346 
347  set title(aTitle) {
348  Utilities.bookmarks.setItemTitle(this._id, aTitle);
349  },
350 
351  get uri() {
352  return Utilities.bookmarks.getBookmarkURI(this._id);
353  },
354 
355  set uri(aURI) {
356  return Utilities.bookmarks.changeBookmarkURI(this._id, aURI);
357  },
358 
359  get description() {
360  return this._annotations.get("bookmarkProperties/description");
361  },
362 
363  set description(aDesc) {
364  this._annotations.set("bookmarkProperties/description", aDesc, Ci.nsIAnnotationService.EXPIRE_NEVER);
365  },
366 
367  get keyword() {
368  return Utilities.bookmarks.getKeywordForBookmark(this._id);
369  },
370 
371  set keyword(aKeyword) {
372  Utilities.bookmarks.setKeywordForBookmark(this._id, aKeyword);
373  },
374 
375  get type() {
376  return this._type;
377  },
378 
379  get parent() {
380  return this._parent;
381  },
382 
383  set parent(aFolder) {
384  Utilities.bookmarks.moveItem(this._id, aFolder.id, Utilities.bookmarks.DEFAULT_INDEX);
385  // this._parent is updated in onItemMoved
386  },
387 
388  get annotations() {
389  return this._annotations;
390  },
391 
392  get events() {
393  return this._events;
394  },
395 
396  remove : function bm_remove() {
397  Utilities.bookmarks.removeItem(this._id);
398  },
399 
400  // observer
401  onBeginUpdateBatch : function bm_obub() {
402  },
403 
404  onEndUpdateBatch : function bm_oeub() {
405  },
406 
407  onItemAdded : function bm_oia(aId, aFolder, aIndex) {
408  // bookmark object doesn't exist at this point
409  },
410 
411  onBeforeItemRemoved : function bm_obir(aId) {
412  },
413 
414  onItemRemoved : function bm_oir(aId, aFolder, aIndex) {
415  if (this._id == aId)
416  this._events.dispatch("remove", aId);
417  },
418 
419  onItemChanged : function bm_oic(aId, aProperty, aIsAnnotationProperty, aValue) {
420  if (this._id == aId)
421  this._events.dispatch("change", aProperty);
422  },
423 
424  onItemVisited: function bm_oiv(aId, aVisitID, aTime) {
425  },
426 
427  onItemMoved: function bm_oim(aId, aOldParent, aOldIndex, aNewParent, aNewIndex) {
428  if (this._id == aId) {
429  this._parent = new BookmarkFolder(aNewParent, Utilities.bookmarks.getFolderIdForItem(aNewParent));
430  this._events.dispatch("move", aId);
431  }
432  },
433 
434  QueryInterface : XPCOMUtils.generateQI([Ci.fuelIBookmark, Ci.nsINavBookmarkObserver])
435 };
436 
437 
438 //=================================================
439 // BookmarkFolder implementation
440 function BookmarkFolder(aId, aParent) {
441  this._id = aId;
442  this._parent = aParent;
443  this._annotations = new Annotations(this._id);
444  this._events = new Events();
445 
446  Utilities.bookmarks.addObserver(this, false);
447 
448  var self = this;
449  gShutdown.push(function() { self._shutdown(); });
450 }
451 
452 BookmarkFolder.prototype = {
453  _shutdown : function bmf_shutdown() {
454  this._annotations = null;
455  this._events = null;
456 
457  Utilities.bookmarks.removeObserver(this);
458  },
459 
460  get id() {
461  return this._id;
462  },
463 
464  get title() {
465  return Utilities.bookmarks.getItemTitle(this._id);
466  },
467 
468  set title(aTitle) {
469  Utilities.bookmarks.setItemTitle(this._id, aTitle);
470  },
471 
472  get description() {
473  return this._annotations.get("bookmarkProperties/description");
474  },
475 
476  set description(aDesc) {
477  this._annotations.set("bookmarkProperties/description", aDesc, Ci.nsIAnnotationService.EXPIRE_NEVER);
478  },
479 
480  get type() {
481  return "folder";
482  },
483 
484  get parent() {
485  return this._parent;
486  },
487 
488  set parent(aFolder) {
489  Utilities.bookmarks.moveItem(this._id, aFolder.id, Utilities.bookmarks.DEFAULT_INDEX);
490  // this._parent is updated in onItemMoved
491  },
492 
493  get annotations() {
494  return this._annotations;
495  },
496 
497  get events() {
498  return this._events;
499  },
500 
501  get children() {
502  var items = [];
503 
504  var options = Utilities.history.getNewQueryOptions();
505  var query = Utilities.history.getNewQuery();
506  query.setFolders([this._id], 1);
507  var result = Utilities.history.executeQuery(query, options);
508  var rootNode = result.root;
509  rootNode.containerOpen = true;
510  var cc = rootNode.childCount;
511  for (var i=0; i<cc; ++i) {
512  var node = rootNode.getChild(i);
513  if (node.type == node.RESULT_TYPE_FOLDER) {
514  var folder = new BookmarkFolder(node.itemId, this._id);
515  items.push(folder);
516  }
517  else if (node.type == node.RESULT_TYPE_SEPARATOR) {
518  var separator = new Bookmark(node.itemId, this._id, "separator");
519  items.push(separator);
520  }
521  else {
522  var bookmark = new Bookmark(node.itemId, this._id, "bookmark");
523  items.push(bookmark);
524  }
525  }
526  rootNode.containerOpen = false;
527 
528  return items;
529  },
530 
531  addBookmark : function bmf_addbm(aTitle, aUri) {
532  var newBookmarkID = Utilities.bookmarks.insertBookmark(this._id, aUri, Utilities.bookmarks.DEFAULT_INDEX, aTitle);
533  var newBookmark = new Bookmark(newBookmarkID, this, "bookmark");
534  return newBookmark;
535  },
536 
537  addSeparator : function bmf_addsep() {
538  var newBookmarkID = Utilities.bookmarks.insertSeparator(this._id, Utilities.bookmarks.DEFAULT_INDEX);
539  var newBookmark = new Bookmark(newBookmarkID, this, "separator");
540  return newBookmark;
541  },
542 
543  addFolder : function bmf_addfolder(aTitle) {
544  var newFolderID = Utilities.bookmarks.createFolder(this._id, aTitle, Utilities.bookmarks.DEFAULT_INDEX);
545  var newFolder = new BookmarkFolder(newFolderID, this);
546  return newFolder;
547  },
548 
549  remove : function bmf_remove() {
550  Utilities.bookmarks.removeItem(this._id);
551  },
552 
553  // observer
554  onBeginUpdateBatch : function bmf_obub() {
555  },
556 
557  onEndUpdateBatch : function bmf_oeub() {
558  },
559 
560  onItemAdded : function bmf_oia(aId, aFolder, aIndex) {
561  // handle root folder events
562  if (!this._parent)
563  this._events.dispatch("add", aId);
564 
565  // handle this folder events
566  if (this._id == aFolder)
567  this._events.dispatch("addchild", aId);
568  },
569 
570  onBeforeItemRemoved : function bmf_oir(aId) {
571  },
572 
573  onItemRemoved : function bmf_oir(aId, aFolder, aIndex) {
574  // handle root folder events
575  if (!this._parent || this._id == aId)
576  this._events.dispatch("remove", aId);
577 
578  // handle this folder events
579  if (this._id == aFolder)
580  this._events.dispatch("removechild", aId);
581  },
582 
583  onItemChanged : function bmf_oic(aId, aProperty, aIsAnnotationProperty, aValue) {
584  // handle root folder and this folder events
585  if (!this._parent || this._id == aId)
586  this._events.dispatch("change", aProperty);
587  },
588 
589  onItemVisited: function bmf_oiv(aId, aVisitID, aTime) {
590  },
591 
592  onItemMoved: function bmf_oim(aId, aOldParent, aOldIndex, aNewParent, aNewIndex) {
593  // handle this folder event, root folder cannot be moved
594  if (this._id == aId) {
595  this._parent = new BookmarkFolder(aNewParent, Utilities.bookmarks.getFolderIdForItem(aNewParent));
596  this._events.dispatch("move", aId);
597  }
598  },
599 
600  QueryInterface : XPCOMUtils.generateQI([Ci.fuelIBookmarkFolder, Ci.nsINavBookmarkObserver])
601 };
602 
603 //=================================================
604 // BookmarkRoots implementation
605 function BookmarkRoots() {
606  var self = this;
607  gShutdown.push(function() { self._shutdown(); });
608 }
609 
610 BookmarkRoots.prototype = {
611  _shutdown : function bmr_shutdown() {
612  this._menu = null;
613  this._toolbar = null;
614  this._tags = null;
615  this._unfiled = null;
616  },
617 
618  get menu() {
619  if (!this._menu)
620  this._menu = new BookmarkFolder(Utilities.bookmarks.bookmarksMenuFolder, null);
621 
622  return this._menu;
623  },
624 
625  get toolbar() {
626  if (!this._toolbar)
627  this._toolbar = new BookmarkFolder(Utilities.bookmarks.toolbarFolder, null);
628 
629  return this._toolbar;
630  },
631 
632  get tags() {
633  if (!this._tags)
634  this._tags = new BookmarkFolder(Utilities.bookmarks.tagsFolder, null);
635 
636  return this._tags;
637  },
638 
639  get unfiled() {
640  if (!this._unfiled)
641  this._unfiled = new BookmarkFolder(Utilities.bookmarks.unfiledBookmarksFolder, null);
642 
643  return this._unfiled;
644  },
645 
646  QueryInterface : XPCOMUtils.generateQI([Ci.fuelIBookmarkRoots])
647 };
648 
649 
650 //=================================================
651 // Factory - Treat Application as a singleton
652 // XXX This is required, because we're registered for the 'JavaScript global
653 // privileged property' category, whose handler always calls createInstance.
654 // See bug 386535.
657  createInstance: function af_ci(aOuter, aIID) {
658  if (aOuter != null)
659  throw Components.results.NS_ERROR_NO_AGGREGATION;
660 
661  if (gSingleton == null) {
662  gSingleton = new Application();
663  }
664 
665  return gSingleton.QueryInterface(aIID);
666  }
667 };
668 
669 
670 
671 //=================================================
672 // Application constructor
673 function Application() {
674  this.initToolkitHelpers();
675  this._bookmarks = null;
676 }
677 
678 //=================================================
679 // Application implementation
680 Application.prototype = {
681  // for nsIClassInfo + XPCOMUtils
682  classDescription: "Application",
683  classID: Components.ID("fe74cf80-aa2d-11db-abbd-0800200c9a66"),
684  contractID: "@mozilla.org/fuel/application;1",
685 
686  // redefine the default factory for XPCOMUtils
687  _xpcom_factory: ApplicationFactory,
688 
689  // for nsISupports
690  QueryInterface : XPCOMUtils.generateQI([Ci.fuelIApplication, Ci.extIApplication, Ci.nsIObserver, Ci.nsIClassInfo]),
691 
692  getInterfaces : function app_gi(aCount) {
693  var interfaces = [Ci.fuelIApplication, Ci.extIApplication, Ci.nsIObserver, Ci.nsIClassInfo];
694  aCount.value = interfaces.length;
695  return interfaces;
696  },
697 
698  // for nsIObserver
699  observe: function app_observe(aSubject, aTopic, aData) {
700  // Call the extApplication version of this function first
701  this.__proto__.__proto__.observe.call(this, aSubject, aTopic, aData);
702  if (aTopic == "xpcom-shutdown") {
703  this._bookmarks = null;
704  Utilities.free();
705  }
706  },
707 
708  get bookmarks() {
709  if (this._bookmarks == null)
710  this._bookmarks = new BookmarkRoots();
711 
712  return this._bookmarks;
713  },
714 
715  get windows() {
716  var win = [];
717  var enum = Utilities.windowMediator.getEnumerator("navigator:browser");
718 
719  while (enum.hasMoreElements())
720  win.push(new Window(enum.getNext()));
721 
722  return win;
723  },
724 
725  get activeWindow() {
726  return new Window(Utilities.windowMediator.getMostRecentWindow("navigator:browser"));
727  }
728 };
729 
730 //module initialization
731 function NSGetModule(aCompMgr, aFileSpec) {
732  // set the proto, defined in extApplication.js
733  Application.prototype.__proto__ = extApplication.prototype;
734  return XPCOMUtils.generateModule([Application]);
735 }
736 
737 #include ../../../mozexthelper/extApplication.js
menuItem id
Definition: FeedWriter.js:971
onPageChanged aValue
Definition: FeedWriter.js:1395
function BrowserTab(aFUELWindow, aBrowser)
var windows
var history
onPageChanged onEndUpdateBatch
Definition: FeedWriter.js:1395
var gSingleton
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
var menu
Element Properties events
sidebarFactory createInstance
Definition: nsSidebar.js:351
sbOSDControlService prototype QueryInterface
var Utilities
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function Application()
var ApplicationFactory
function BookmarkFolder(aId, aParent)
getService(Ci.sbIFaceplateManager)
let window
this _window
Definition: FeedWriter.js:1158
BogusChannel prototype open
function makeURI(aURLSpec, aCharset)
Definition: FeedWriter.js:71
var gShutdown
var tabs
Element Properties load
const Cc
onPageChanged onBeginUpdateBatch
Definition: FeedWriter.js:1395
return null
Definition: FeedWriter.js:1143
let node
function BookmarkRoots()
var Events
function Bookmark(aId, aParent, aType)
SimpleArrayEnumerator prototype hasMoreElements
_updateCookies aName
var uri
Definition: FeedWriter.js:1135
_updateTextAndScrollDataForTab aBrowser
foldersync options
Definition: options.js:13
sbDeviceFirmwareAutoCheckForUpdate prototype classID
function Annotations(aId)
var ios
Definition: head_feeds.js:5
restoreHistoryPrecursor aCount
sbDeviceFirmwareAutoCheckForUpdate prototype getInterfaces
sbDeviceFirmwareAutoCheckForUpdate prototype interfaces
var _browser
function NSGetModule(aCompMgr, aFileSpec)
let< body >< buttononblur="this.parentNode.removeChild(this);">< script > document body firstChild focus()
_getSelectedPageStyle s i
function Window(aWindow)
function extApplication()
_updateTextAndScrollDataForFrame aData
const Ci
sbDeviceFirmwareAutoCheckForUpdate prototype observe