A few questions

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
Guest

A few questions

Post by Guest »

Hi,

1. Is there a way to distinguish PWB from MSIE when using navigatior.appName or navigator.userAgent or similar properties as PWB returns exactly same results as MSIE ?

2. Is it possible to dynamically remove the tool bars, status bar etc using javascript ?

3. Is it possible to dynamically modify configuration file from a webpage ?

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

1. PWB uses the IE Web Browser Control to do all the HTML rendering, it is the control that is reporting itself as IE. There is no way to distinguish the two.

2. Using PWB v2.05 it is possible to use the external java commands to dynamically hide the toolbar. To hide the toolbar use the JavaHideToolbar=PWBHideToolbar java command. Please see the following page for examples of the external java command.

http://www.teamsoftwaresolutions.com/beta/external.htm

We can add more external java commands to meet your needs, please email Support@TeamsoftwareSolutions.com for more details.

PWB also responds to the JavaScript window.open with no toolbar or status bar.

3. PWB can only modify a few of the settings through the external java commands, but we could certainly add more. You could also use the external java commands to open Notepad with the INI showing.

--Scott

Guest

Post by Guest »

So is there any other property which PWB has and IE doesn't ? For example can I check existence of .ini file or a configuration parameter or even get the full text from the title bar ( which contains browser name ) to distinguish PWB from IE ?

Thanks

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

If you have access to the local machine there are several places you could verify if PWB was running. For example, when PWB runs it sets the Application Handle as a DWORD value in the following registry location.

HKEY_CURRENT_USER
Software\\TeamSoftware Solutions\\Public Web Browser v2\App_Handle

You could also check for the PWB.EXE process.

--Scott

Guest

Post by Guest »

scott,

Thanks for reply. Few points I forgot to mention explicitly:

1. I need to do it in javascript. I don't think the measures you suggested are possible in JS. I may be wrong.

2. If both IE and PWB are running then I would need to know that the process I am in is actually PWB and not IE.

Thanks in advance

Guest

Post by Guest »

I couldn't get the external command example page working. Whenever I click on the button I get error messages object doesn't support this property or method. For dummy and exit link nothing happens.

Can you please post a working example if possible.

When I do window.external.JavaHideToolbar=PWBHideToolbar as you suggested I get PWBHideToolbar is undefined.

function OnClickDummy()
{

window.external.JavaHideToolbar=PWBHideToolbar;
//window.external.PWBDummy

}

I have version 2.05 of PWB.

Am I doing something wrong ?

Thanks

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

In the [Java] section of the PWB INI you should have the following set.

[Java]
...
JavaHideToolbar=PWBHideToolbar
...

Then the Java command as follows should work.

window.external.PWBHideToolbar

The java commands are dynamic and must match what is specified in the PWB INI file.

On the sample page, the dummy command is there just to show it does not effect PWB.

http://www.teamsoftwaresolutions.com/beta/external.htm

This sample page works with the following dynamic external java command set.

[Java]
JavaExit=PWBExit
JavaActivity=PWBActivity
JavaRegister=PWBRegister
JavaHideToolbar=PWBHideToolbar
JavaExecute=PWBExecute
JavaReadINIFile=PWBReadINI

--Scott

Guest

Post by Guest »

Looks like we got bigger problems. Got the following error message when I got the external commands working. Do I need to give some permissions exclusively ?

Unhandled exception at 0x00404d4b in PWB.exe: 0xC0000005: Access violation reading location 0x00000008.

Guest

Post by Guest »

Ok. figured out what the problem is. We need a () to call the method.
so following gives the memory exception

window.external.PWBExit

while

window.external.PWBExit() works.

Now the question is how do I make it work accross the users? Say for example user 1 has following setting :

JavaHideToolbar=MyHideToolbar

and user 2 has following

JavaHideToolbar=PWBHideToolbar


calling function with window.external.PWBHideToolbar() will give error for user 1.

Is there a way to get what a user has set in there and then call it dynamically ?

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

Could you use the JavaScript error handling to sort it out.

try {
// code that can cause an error
}
catch (all) {
// code to handle the error
}

--Scott

Post Reply