Launching a website widget

You can create a widget that launches your website from the applications menu by editing one line of HTML code in the OpenURL.wgz example widget. OpenURL.wgz launches the Forum Nokia Web Runtime widgets website in the S60 Browser. You can modify this widget to launch your website by editing the URL it launches (via widget.openURL) and replacing the icon.

Figure: OpenURL.wgz

To edit OpenURL.wgz

Follow these instructions to edit OpenURL.wgz so that it launches your website in the Web Browser for S60 and displays an icon of your choice in the applications menu.

  1. Download the OpenURL widget example (OpenURL).

    The example contains a packaged widget (OpenURL.wgz).

  2. Change the extension of the widget from OpenURL.wgz to OpenURL.zip and unzip the files using a ZIP utility. You should see the following files:

  3. Replace Icon.png with the icon that you want displayed in the application menu.

  4. Open the widget.html file in an editor and replace the URL, www.forum.nokia.com/Resources_and_Information/Explore/Web_Technologies/Web_Runtime with the URL to your website.

    <html>
    <head>
    <script type="text/javascript">
    	
    <!--
    function doRedirect()
    {
        widget.openURL("http://www.forum.nokia.com/Resources_and_Information/Explore/Web_Technologies/Web_Runtime");
    	   window.close();
    }
    //-->
    </script>
    
    </head>
    
    <body onload="doRedirect()">
    
    </body>
    
    </html>
    
  5. Create the widget installation package:

    1. Select the OpenURL directory using a ZIP utility.

    2. Create a ZIP archive of the directory.

      Note: The directory must be included in the ZIP archive. That is, the root of the ZIP archive must contain the directory, which in turn contains the widget component files.

    3. Change the extension of the ZIP file from .zip to .wgz.

  6. Test your widget by deploying it to a mobile device (that supports WRT widgets) as described in Deploying widgets.