Chris Pollett > Students >
Periyapatna

    ( Print View )

    [Bio]

    [Project Blog]

    [CS297 Proposal]

    [Deliverable 1 - Hello World Extension]

    [Presentation on XUL-PPT]

    [Deliverable2 - Capture Events]

    [Deliverable3 - Preferences]

    [Deliverable4 - Caching]

    [CS297 Report - PDF]

    [CS298 Proposal]

    [CS298 Report - PDF]

    [CS298 Presentation- PPT]

    [Download Project-ZIP]

    [Installation Guide]

                          

























Deliverable 3 - Preference

Preference System

Description: The third deliverable was about creating a preference system. A preference is any value or defined behavior that can be set by the user. Preference changes via user interface, usually a preference dialog, takes effect immediately. Following is the preference file used to create the preference dialog. Figure below that shows the preference dialog. The path to the preference XUL file should be given in the install.manifest file.

<?xml version = "1.0"?>
<?xml-stylesheet href = "chrome://global/skin/" type = "text/css"?> 
<prefwindow id = "myExtensionOptions" type = "prefwindow"      
xmlns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"     
buttons = "accept, cancel" title = "My Options">

      <prefpane id = "myPane" flex = "1" >
  	<preferences id = "tabsPreferences">
	       <preference id = "extensions.my_extension.myOptions"      
                		          name = "extensions.my_extension.myOptions" type = "int"/>
	 </preferences>
	 <script type = "application/x-javascript" src = "chrome://sample/content/pref.js"/>
	 <radiogroup id = "myOpt" preference = "extensions.my_extension.myOptions">
	        <radio label = "Three sec" value = "2" />
	        <radio label = "Five sec" value = "3"/>
	        <radio label = "Ten sec" value = "4"/>
	 </radiogroup>
     </prefpane> 
</prefwindow>

Text_description

An observer is added to receive notifications whenever users change the preference. The callback function then executes so that the changes takes effect immediately. In this deliverable the preference system was added so that users can select the interval at which they want to cache pages.