BBjHtmlView::getUserAgent

Description

In BBj 15.00 and higher, this method returns the user agent string for this BBjHtmlView control.

Syntax

Return Value

Method

string

getUserAgent()

Parameters

None.

Return Value

Returns the user agent string for the BBjHtmlView control.

Remarks

For more information about the user agent string, go to Navigator: userAgent property

Example

rem ' BBjHtmlView::getUserAgent

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "BBjHtmlView::getUserAgent"
window! = sysgui!.addWindow(50,50,800,400,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")
getUserAgent! = window!.addButton(1,25,25,150,25,"getUserAgent",$$)
getUserAgent!.setCallback(getUserAgent!.ON_BUTTON_PUSH,"getUserAgent")
setUserAgent! = window!.addButton(2,25,75,150,25,"setUserAgent",$$)
setUserAgent!.setCallback(setUserAgent!.ON_BUTTON_PUSH,"setUserAgent")
userAgent! = window!.addEditBox(101,200,75,575,25,"",$$)
htmlview! = window!.addHtmlView(102,25,125,750,250,"",$$)
gosub display

process_events
eoj:
  release

display:
  js$ = "navigator.userAgent"
  userAgent$ = str(htmlview!.executeScript(js$))
  text$ = js$ + " = " + userAgent$
  htmlview!.setText(text$)
return

resize:
  event! = sysgui!.getLastEvent()
  htmlview!.setSize(event!.getWidth()-50,event!.getHeight()-150)
  userAgent!.setSize(event!.getWidth()-225,userAgent!.getHeight())
return

getUserAgent:
  userAgent$ = htmlview!.getUserAgent()
  userAgent!.setText(userAgent$)
return

setUserAgent:
  htmlview!.setText("")
  htmlview!.setUserAgent(userAgent!.getText())
  gosub display
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

BBjHtmlView::setUserAgent

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.