best web browser software | fastest web browser download

Developing Script Plugins For Slim Browser
1. Safe Script (With restricted access to local resources)

Safe Script is just a standard javascript (.js) or vbscript file (.vbs). The script file will be executed under the scripting context of the active site/web page. That is the script will have the same effect as if it's run from within the html source code. You have full access to the DOM (document object model) of the active html page. For example, you can directly refer to objects like window, document, etc. If you access local resources from within the safe script, you will be liable to the security settings defined in Internet Options. The default security setting only allows you to create ActiveX objects that're signed and marked as safe for scripting.

If you want the script to be executed within all frames/sub-frames of the active page, place a comment line at the top of the script and include the tag AllFrames. For example, the first line can be //AllFrames,other tags....

2. Power Script (With access to local resources)

Power Script works like the menu/toolbar extension for Internet Explorer. It is also a javascript file (.js) or vbscript file (.vbs). You need place a comment line at the top of the script and include the tag LocalAccess to mark a script file as power script. Power Script will be executed in a separate scripting context. Thus you don't have direct access to DHTML DOM. However you can still access the window object of the active page in SlimBrowser by external.menuArguments (same as the standard for designing a script extension for IE). You can access the DOM by way of external.menuArguments. In a power script, you can have unlimited access to all local resources, including local files and all kinds of ActiveX objeccts. In a word, Power Script is fully trusted scripts. It works like a HTML Application.

An example power script

//LocalAccess
var obj=new ActiveXObject("Word.Application");
obj.Visible=true;
delete obj;

The above script will create an instance of Microsoft Word and make it visible.

Script Location (common to safe script and power script)
  • You can place the script files under the $installdir\scripts folder. It will accessible from the Scripts drop-down toolbar button. You may need customize the standard toolbar to show the "Scripts" button.
  • You can place the script files under any of these folders: Favorites, Links and Utilities. Then you will be able to access them from Favorites, Links and Utilities toolbar or menu.

 

best web browser software | fastest web browser download | free web browser

Copyright© 2009 FlashPeak Inc. All rights reserved.