Prism/Scripting: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 28: Line 28:
};
};
</pre>
</pre>
==HostUI methods==
The methods exposed by the HostUI object allow interaction with the Prism runtime environment. 
; void log(aMsg);
: Logs a message to the Prism error console. 
; browser getBrowser();
: Returns a reference to the XUL [http://developer.mozilla.org/en/docs/XUL:browser Browser] object which displays the Prism documents
; showAlert(aImage, aTitle, aMsg);
: showAlert provides a thin wrapper around the [http://developer.mozilla.org/en/docs/nsIAlertsService nsIAlertsService.showAlertNotification] XPCOM method.
:; aImage
:: A URL to the image which should be displayed in the notification
:; aTitle
:: The string to be used as the title for the alert
:; aMsg
:: The text of the message to be displayed in the alert


There are also hooks that are called when Prism has loaded and when it is about to exit. You can declare these functions in the webapp script:
There are also hooks that are called when Prism has loaded and when it is about to exit. You can declare these functions in the webapp script:
2

edits