Way to hide toolbar in different browsers?

Can anyone tell me if there’s a way to have Applescript hide the toolbar in Internet Explorer and Safari?

I’ve got an app that I’ve written that launches the user’s default web-browser (which most likely will be IE or Safari). My client wants my app to hide the BACK/FORWARD/Refresh buttons (hide the toolbar). In IE, I can do this by creating a dummy .htm file with a “window.open” and “toolbars=no” parameter. However, in Safari this doesn’t work, as Safari treats the window.open as a popup, which is blocked on most users Safari browsers.

Perhaps there’s a better way - - - a Javascript method that hides the toolbars, yet doesn’t require window.open?

I am not a javascript expert, but I think it doesn’t exist such function.

Two possible workarounds:
-Modify Safari’s preferences (set “show back-forward” to false OR “block popup” to false) before launching the default browser.
-Not polite, but you can use GUI scripting.

workaround 1 (never tried, but should work):

do shell script "defaults write com.apple.safari 'AddressBarIncludesBackForward' 0"

0 = false; 1 = true.

workaround 2 (if you find any problem post another question :twisted: )

JJ’s method does work, I tried it. Also you can use “defaults read com.apple.safari” to see what else you can modify.