WEBTOP WIDGET

INTRODUCTION

The Webtop Widget is a sample JavaScript component that opens a "Webtop" from Navigator 4.0 or higher.

You can specify your own HTTP URL for the Webtop via the following HTML Form:

Note: submitting this form will open the webtop, which must be prefixed with "http://". To close the webtop, click on it and press Ctrl+W or Alt+F4, depending on your platform hot-keys.

You can also use this digitally signed script with un-signed web pages by adding the script to your web page, like this:

<SCRIPT LANGUAGE="JavaScript1.2" SRC="webtop.js" ARCHIVE="webtop.jar">

Then call your page with the URL of your webtop attached as a query string, something like this:

http://www.yourdomain.com/yourpage.html?http://www.yourdomain.com/yourwebtop.html

This will open the webtop containing your query string URL.

HOW IT WORKS

Contained within the webtop.jar archive is a JavaScript library file entitled webtop.js. The code in this library contains the following function:


function openWebtop() {
    var url = location.search.substring(1,location.search.length);
    netscape.security.PrivilegeManager.enablePrivilege('CanvasAccess'); 
    window.webtopWin = window.open(url || "http://developer.netscape.com", 'webtop', 'alwaysLowered=yes,outerWidth='+ screen.availWidth +',outerHeight='+ screen.availHeight +',left='+ screen.availLeft +',top='+ screen.availTop +',titlebar=no');
}

The openWebtop() function is a part of this digitally signed script, which requests the "CanvasAccess" privilege via the netscape.security.PrivilegeManager to display the Webtop.

Webtops use this customizable "Canvas" mode to display a chrome-less "unframed" window, which is without a titlebar, menubar, statusbar or scrollbars, and can cover the entire desktop and be locked to the back-most layer of the display.

That's the idea in Webtops and Canvas mode, such that developers can display windows in a different way without the normal native window features, for various reasons, such as for building your own menubar or scrollbars that are unique and/or cross-platform.

Check out Visual DHTML, which illustrates examples of customized scrollbars, menubars, toolbars, statusbar, etc. in DHTML.

SCROLLBARS

If you're not interested in customized scrollbars, then host your webtop page inside a frameset, and the frames-based scrollbars will work for scrolling your webtop. For example, I created a page with a simple frameset that allows you to specify your own URL for the main content frame. You can access this frameset with your URL from the following form:

Scrollbars will appear for pages that need them via the frameset.

MORE EXAMPLES

The Webtop Widget is free to the public, and you can submit your URL for possible posting here, if you use the Webtop Widget on your page, such as the following sites have done:

DOWNLOAD

You should have no problems running your webtop from this page on-line; however, for off-line usage you can download the following ZIP archive which contains the webtop.jar:

webtop.zip

RESOURCES AND SUPPORT

For more information on developing Webtops, check out Visual DHTML, which supports Webtops.

Also, check out our Netcaster Documentation page, which includes information on Webtops.

For more information on signed scripts, view our JavaScript Security in Communicator 4.x page.

If you need technical support or other assistance, please visit the support area.

For the latest technical information on Sun-Netscape Alliance products, go to: http://developer.iplanet.com

For more Internet development resources, try Netscape TechSearch.


Copyright © 1999 Netscape Communications Corporation.
This site powered by: Netscape Enterprise Server and Netscape Compass Server.