Site-Specific Preferences: Difference between revisions

 
Line 256: Line 256:


For location changes, the controller calls nsIObserver::observe with:
For location changes, the controller calls nsIObserver::observe with:
* subject: the URI of the new location;
* aSubject: the URI of the new location;
* topic: "content-pref-location-changed";
* aTopic: "content-pref-location-changed";
* data: the value of the site-specific preference for the new location.
* aData: the value of the site-specific preference for the new location.


For DOMContentLoaded events, the controller calls nsIObserver::observe with:
For DOMContentLoaded events, the controller calls nsIObserver::observe with:
* subject: the document object whose content was loaded;
* aSubject: the document object whose content was loaded;
* topic: "content-pref-dom-content-loaded";
* aTopic: "content-pref-dom-content-loaded";
* data: the value of the site-specific preference for the document.
* aData: the value of the site-specific preference for the document.


Note: this doesn't actually conform to the nsIObserver interface, in which data is a wstring, so it will only work with pref handlers implemented in JavaScript.
Note: this doesn't actually conform to the nsIObserver interface, in which aData is a wstring, so it will only work with pref handlers implemented in JavaScript and registered without going through XPCOM.


<strong>Should we define an nsIObserver2 interface in which data is an nsIVariant?</strong>
<strong>Should we define an nsIObserver2 interface in which aData is an nsIVariant?</strong>


<strong>Are these the right topic names for these notifications?</strong>
<strong>Are these the right topic names for these notifications?</strong>


<strong>Should subject be the event rather than the document for DOMContentLoaded notifications?</strong>
<strong>Should aSubject be the event object rather than the document object for DOMContentLoaded notifications?</strong>
 
<strong>Will any pref handlers want to know about pageshow/hide?</strong>


== Text Zoom Handler ==
== Text Zoom Handler ==
canmove, Confirmed users
2,056

edits