BBjHtmlView

Description

The BBjHtmlView control displays HTML files, and can act as a complete embedded web browser, with support for HTML5, CSS, and JavaScript.

The BBjHtmlView can be configured through STBL options to be either a basic container for static HTML 3.2 content, or a complete embedded Chromium-based browser. See STBL Options for BBjHtmlView below.

Access to the CHROMIUM_HTMLVIEW feature requires an active Software Asset Management (SAM) subscription. See Benefits of ‘Software Asset Management' Feature Line.

The WEBGUI_HTMLVIEW feature is only available in the WEBGUI client, and requires a WEBGUI BLS license.

Implemented Interfaces

DragSource, DropTarget, Focusable, TabTraversable

Creation

BBjAPI > BBjSysGui > BBjWindow > BBjHtmlView

A BBjHtmlView object is created through the following BBjWindow methods:

Return Value Method

BBjHtmlView

addHtmlView(int ID, number x, number y, number w, number h, string html)

BBjHtmlView

addHtmlView(int ID, number x, number y, number w, number h, string html, string flags)

BBjHtmlView

addHtmlView(int ID, number x, number y, number w, number h, string html, string flags, string chromium_switches$)

BBjHtmlView

addHtmlView(int ID, String html)

BBjHtmlView

addHtmlView(int ID, String html, string flags)

BBjHtmlView

addHtmlView(int ID, String html, string flags, string chromium_switches)

BBjHtmlView

addHtmlView(String html)

BBjHtmlView

addHtmlView(String html, string flags)

BBjHtmlView

addHtmlView(String html, string flags, string chromium_switches)

Methods of BBjHtmlView

Return Value Method
int executeAsyncScript(String script)
int executeAsyncScript(String script, boolean await)
int executeAsyncScript(String script, boolean await, boolean event)
Object executeScript(String script)
Object executeScript(String script, boolean await)

boolean

getAutoNavigate()

string

getClientType()

string

getClientVersion()

string getDownloadDirectory()

BBjImage

getImage()

string

getText()

string

getUrl()

string

getUserAgent()

void

injectScript(String script)

void

injectScript(String script, boolean top)

void

injectUrl(String url)

void

injectUrl(String url, boolean top)

boolean

print()

void

setAutoNavigate(boolean autoNavigate)

void setDownloadDirectory(String directory)

void

setUrl(String url)

void

setUrl(String url, String loader)

void

setUserAgent(String userAgent)

Methods of BBjHtmlView inherited from BBjControl

Constants inherited from BBjControl

Open Events

OpenBUI logo

The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.

The BBjHtmlView control is a <div> containing a content field with a class name of .BBjHtmlView-content. If the content is set using setUrl(), it is an <iframe>. If the content is set using setText(), it is a <div> containing the specified HTML. The BBjHtmlView defines the following CSS style names:

.BBjHtmlView (the top level control)

.BBjHtmlView-content (the content, either an iframe or a div)

.BBjHtmlView.bbj-disabled (the control is disabled)

Open STBL Options for BBjHtmlView

The BBjHtmlView can be configured through STBL options to be either a basic container for static HTML 3.2 content, or a complete embedded Chromium-based browser. Using the Chromium browser engine is limited to the operating systems and platforms on which the Chromium engine is supported.

The STBL("!OPTIONS") CHROMIUM_HTMLVIEW and STBL("!OPTIONS") WEBGUI_HTMLVIEW options can be used to select a specific BBjHtmlView content engine.

Access to the CHROMIUM_HTMLVIEW feature requires an active Software Asset Management (SAM) subscription. See Benefits of ‘Software Asset Management' Feature Line.

The WEBGUI_HTMLVIEW feature is only available in the WEBGUI client, and requires a WEBGUI BLS license.

If the Chromium-based BBjHtmlView is used, the STBL("!CHROMIUM_SWITCHES") string can specify an arbitrary number of space-delimited Chromium command-line switches (e.g. "--remote-debugging-port=9223 --lang=de"). These switches are passed on to CHROMIUM_HTMLVIEW BBjHtmlView clients, unless the version of the addHtmlView method that explicitly specifies the chromium_switches$ parameter is used.

OpenVersion History

Example

rem ' BBjHtmlView
url$ = "https://en.wikipedia.org"							
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,600,500,url$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")
htmlview! = window!.addHtmlView(102,25,25,550,450,"",$$)
htmlview!.setUrl(url$)
htmlview!.setAutoNavigate(1)
clientType$ = htmlview!.getClientType()
clientVersion$ = htmlview!.getClientVersion()
title$ = window!.getTitle() + " " + clientType$ + " " + clientVersion$
window!.setTitle(title$)
status! = window!.addStatusBar(99)
process_events

eoj:
release

resize:
    gosub event
    width = event!.getWidth() - 50
    height = event!.getHeight() - 50
    htmlview!.setSize(width,height)
    status$ = event!.getEventName()+" width="+str(width)+",height="+str(height)
    status!.setText(status$)
return

event:
    event! = sysgui!.getLastEvent()
    status$ = event!.getEventName()
    status!.setText(status$)
return
Example Type: BBj

See Also

BBjAPI

BBjSysGui

BBjWindow

CALLBACK Verb - Register BBj Subroutine

STBL("!OPTIONS") CHROMIUM_HTMLVIEW

STBL("!OPTIONS") WEBGUI_HTMLVIEW

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