qnx.media.QNXStageWebView

QNXStageWebView

Properties | Methods | Events | Constants | Examples


Packageqnx.media
Classpublic final class QNXStageWebView
InheritanceQNXStageWebView Inheritance flash.events.EventDispatcher

The QNXStageWebView class enables you to display browsable HTML content in a stage view port.

The QNXStageWebView class provides a comprehensive means to display HTML content on QNX devices. For example, the QNXStageWebView class provides, methods to pass values or call functions between ActionScript and JavaScript. You can use the QNXStageWebView class to display and browse content on the Web, or to load and render local content. The QNXStageWebView class uses the system web control provided by the device operating system.

The QNXStageWebView class is NOT a display object and cannot be added to the Flash display list. Instead, to display a QNXStageWebView object, you must attach it directly to the stage using the stage property. A QNXStageWebView instance that is attached to a stage is displayed on top of any Flash display objects or behind the stage. There is no way to control the depth ordering of different QNXStageWebView objects with respect to Flash display objects. However, you may set the zOrder property to order the QNXStageWebView objects with respect to each other or the stage.

You can control the size and position of the rendering area by setting the viewPort property.

When the content within the QNXStageWebView object has focus, the QNXStageWebView object has the first opportunity to handle keyboard input. The stage, to which the QNXStageWebView object is attached, dispatches any keyboard input that is not handled. The normal event capture/bubble cycle does not apply here since the QNXStageWebView instance is not part of the display list.

AIR profile support: This feature is supported only on QNX devices. You can test for support at run time using the QNXStageWebView.isSupported property. See AIR Profile Support for more information regarding API support across multiple profiles.



Class information:
PlayBook Tablet OS Version:   1.0.6

View the examples

See also

HistoryItem
WebViewEvent
StageWebView
HTMLLoader



Public Properties

 PropertyDefined By
  active : Boolean
Determines if the browser is active or inactive.
QNXStageWebView
  backgroundColor : uint
Get and set the background color.
QNXStageWebView
  blockPopups : Boolean
Determines whether or not to enable the standard browser popup-blocking engine for generic window.open calls from Javascript.
QNXStageWebView
  certificateInfo : CertificateInfo
[read-only] Retrieves the certificate information for the currently displayed page.
QNXStageWebView
  contentRectangle : Rectangle
[read-only] The rectangle that defines the size of the content of the web page after transformations due to user zoom.
QNXStageWebView
  customHTTPHeaders : Vector.<URLRequestHeader>
Defines custom HTTP headers that are sent in addition to the standard headers.
QNXStageWebView
  defaultFontSize : int
Default font size is applied.
QNXStageWebView
  defaultTextEncoding : String
The default text encoding if the browser cannot auto-detect the encoding of the page.
QNXStageWebView
  displayDefaultDialogs : Boolean
[write-only] Sets a Boolean that determines if default dialogs will be displayed.
QNXStageWebView
  enableCookies : Boolean
Determines whether or not cookies should be saved and sent back to pages.
QNXStageWebView
  enableCrossSiteXHR : Boolean
Determines whether or not to allow cross site XHR (XMLHttpRequest).
QNXStageWebView
  enableDownloadableBinaryFonts : Boolean
Enable or disable downloadable binary fonts.
QNXStageWebView
  enableGeolocation : Boolean
Determines whether or not geolocation APIs should be enabled.
QNXStageWebView
  enableJavaScript : Boolean
Determines whether or not to execute Javascript.
QNXStageWebView
  enableLocalAccessToAllCookies : Boolean
Enable or disable access to cookies associated with file: and local: protocols.
QNXStageWebView
  enablePatternMatching : Boolean
[write-only] Enable or disable pattern matching.
QNXStageWebView
  enablePlugins : Boolean
Determines whether or not plugins should be enabled.
QNXStageWebView
  enableResourceFiltering : Boolean
Enables the following events on this webview.
QNXStageWebView
  enableSpatialNavigation : Boolean
Enable or disable spatial navigation.
QNXStageWebView
  enableWebInspector : Boolean
Determines whether or not web inspector should be enabled.
QNXStageWebView
  enableWebSockets : Boolean
Determines whether or not web sockets should be available to pages.
QNXStageWebView
  encryptionInfo : String
[read-only] Retrieves the encryption info for the currently displayed page.
QNXStageWebView
  favicon : BitmapData
[read-only] Gets the favicon for the current page.
QNXStageWebView
  forcedTextEncoding : String
Forced text encoding is applied.
QNXStageWebView
  historyLength : int
[read-only] The length of the history list.
QNXStageWebView
  historyList : Array
[read-only] Retrieves a copy of the history list.
QNXStageWebView
  historyPosition : int
The position of the currently active page in the history list.
QNXStageWebView
  isHistoryBackEnabled : Boolean
[read-only] Determines whether there is a previous page in the browsing history.
QNXStageWebView
  isHistoryForwardEnabled : Boolean
[read-only] Determines whether there is a next page in the browsing history.
QNXStageWebView
  isSupported : Boolean
[static] [read-only] Determines whether the QNXStageWebView class is supported on the current device.
QNXStageWebView
  javaScriptInterruptTimeout : int
Specifies the timeout period (in seconds) after which a long running piece of JavaScript is interrupted.
QNXStageWebView
  loadImages : Boolean
Determines whether or not to load images when the page is loading.
QNXStageWebView
  loadProgress : int
[read-only] Retrieves the loading progress of the current page.
QNXStageWebView
  location : String
[read-only] The URL of the current location.
QNXStageWebView
  minimumFontSize : int
Get and set the minimum font size.
QNXStageWebView
  originalLocation : String
[read-only] The URL of the originally entered location before any redirects.
QNXStageWebView
  overScrollColor : uint
Get and set the overscroll color.
QNXStageWebView
  privateBrowsing : Boolean
The private browsing flag tells the QNXStageWebView object to enable private browsing mode.
QNXStageWebView
  scroller : Scroller
QNXStageWebView
  scrollPosition : Point
The current scroll position of the content.
QNXStageWebView
  secureType : String
[read-only] Retrieves the security type for the currently displayed page.
QNXStageWebView
  stage : Stage
The stage on which this QNXStageWebView object is displayed.
QNXStageWebView
  status : String
[read-only] Gets the current status bar content.
QNXStageWebView
  textEncoding : String
[read-only] The current text encoding of the content on the page.
QNXStageWebView
  textReflowMode : String
Get and set the text reflow mode.
QNXStageWebView
  title : String
[read-only] The HTML title value.
QNXStageWebView
  tooltip : String
[read-only] Gets the current tool-tip.
QNXStageWebView
  userAgent : String
The user-agent that is currently reported by the browser to servers during HTTP requests and to web content in scripts.
QNXStageWebView
  userStyleSheet : String
Specifies a user stylesheet which overrides the stylesheet that is set by the page.
QNXStageWebView
  viewPort : Rectangle
The area on the stage in which the QNXStageWebView object is displayed.
QNXStageWebView
  visible : Boolean
Specifies the visibility property for this QNXStageWebView instance.
QNXStageWebView
  webInspectorPort : int
[read-only] Get the web inspector port number.
QNXStageWebView
  windowUniqueId : String
[read-only] The unique ID of the window.
QNXStageWebView
  zoom : Number
The current zoom factor of the web view.
QNXStageWebView
  zoomCenter : Point
The center point of the zoomed area.
QNXStageWebView
  zoomToFitWidthOnLoad : Boolean
Determines if the browser will automatically zoom the page to fit the width of the viewport on load.
QNXStageWebView
  zOrder : int
Specifies the z-order of the QNXStageWebView instance with respect to other windows that are children of the stage.
QNXStageWebView

Public Methods

 MethodDefined By
  
QNXStageWebView(name:String, proxy:QNXWebViewProxy = null)
Creates a QNXStageWebView object.
QNXStageWebView
  
assignFocus(direction:String = none):void
Assigns focus to the content within this QNXStageWebView object.
QNXStageWebView
  
Clears browsing data.
QNXStageWebView
  
clearCache():void
Clears the browser cache.
QNXStageWebView
  
Clears any cookie information.
QNXStageWebView
  
Clears all browser history.
QNXStageWebView
  
Clears any local storage.
QNXStageWebView
  
dispose():void
Disposes of this QNXStageWebView object.
QNXStageWebView
  
downloadCancel(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadPause(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadRemove(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadResume(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadRetry(downloadId:uint):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
downloadUpdate(downloadId:uint, action:String, filename:String):void
Used in conjunction with the Downloadevents.
QNXStageWebView
  
drawViewPortToBitmapData(bitmap:BitmapData):void
Draws the QNXStageWebView's view port to a bitmap.
QNXStageWebView
  
executeJavaScript(script:String):String
Executes the JavaScript code that is specified by script asynchronously.
QNXStageWebView
  
executeJavaScriptInWorld(script:String, world:String):String
Executes the JavaScript code that is specified by script asynchronously.
QNXStageWebView
  
findString(string:String, forward:Boolean = true):void
Finds and selects the next/last string that is a case-insensitive match in the web page.
QNXStageWebView
  
Navigates to the previous page in the browsing history.
QNXStageWebView
  
Navigates to the next page in the browsing history.
QNXStageWebView
  
loadFile(path:String, overrideContentType:String):void
Loads the page at the specified file path.
QNXStageWebView
  
loadString(text:String, mimeType:String = text/html):void
Loads and displays the specified HTML string.
QNXStageWebView
  
loadStringWithBase(text:String, baseURL:String, mimeType:String = text/html):void
Loads and displays the specified HTML string with the specified baseURL.
QNXStageWebView
  
loadURL(url:String):void
Loads the page at the specified URL.
QNXStageWebView
  
notifyResourceDataReceived(streamId:int, data:ByteArray):void
Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with custom data and headers.
QNXStageWebView
  
notifyResourceDone(streamId:int):void
Used in conjunction with the NetworkResourceDataRequested event to substitue the network stream with custom data and headers.
QNXStageWebView
  
notifyResourceHeaderReceived(streamId:int, key:String, value:String):void
Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with custom data and headers.
QNXStageWebView
  
notifyResourceOpened(streamId:int, status:int, message:String):void
Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with a custom response code.
QNXStageWebView
  
reload():void
Reloads the current page.
QNXStageWebView
  
removeGeolocationFilter(url:String):void
Remove the geolocation filter associated with a url.
QNXStageWebView
  
removeWebGLFilter(url:String):void
Remove the WebGL filter associated with a url.
QNXStageWebView
  
Request a web session to be saved.
QNXStageWebView
  
restoreSession(session:String, restoreScrollPosition:Boolean = true, restoreZoomScale:Boolean = true, restoreUrl:Boolean = true):void
Request a web session to be restored.
QNXStageWebView
  
scrollBy(dx:int, dy:int):void
Scroll the content by the specified amount (in pixels).
QNXStageWebView
  
setScrolling(scrolling:Boolean):void
Indicate that the web page is being scrolled or is no longer being scrolled.
QNXStageWebView
  
stop():void
Halts the current load operation.
QNXStageWebView
  
textHasAttribute(attribute:String):void
Query the value of a current text attribute.
QNXStageWebView
  
updateGeolocationFilter(url:String, allow:Boolean):void
Set whether a url is allowed access to geolocation information.
QNXStageWebView
  
updateWebGLFilter(url:String, allow:Boolean):void
Set whether a url is allowed to use WebGL.
QNXStageWebView

Events

 Event Summary Defined By
  QNXStageWebView
   QNXStageWebView
  The Event.COMPLETE constant defines the value of the type property of a complete event object.QNXStageWebView
   Dispatched when content of the page is re-rendered.QNXStageWebView
   Dispatched when the QNXStageWebView object is created.QNXStageWebView
   Dispatched when the QNXStageWebView object has been destroyed.QNXStageWebView
   Dispatched when the application receives a response from the server indicating a location change and page load operation.QNXStageWebView
   Dispatched when the javascript document.onload event is fired.QNXStageWebView
   Dispatched when a document load operation fails.QNXStageWebView
   Dispatched when a document load operation has finished.QNXStageWebView
   Signals that the download has started.QNXStageWebView
   Signals that the download has started.QNXStageWebView
   Signals that a download is about to start.QNXStageWebView
   Signals that the download has started.QNXStageWebView
  Indicates that a network error has occurred.QNXStageWebView
  Defines the value of the type property of a focusIn event object.QNXStageWebView
  Defines the value of the type property of a focusOut event object.QNXStageWebView
   Dispatched when the browser (or plugin) has entered full screen mode.QNXStageWebView
   Dispatched when the browser (or plugin) is about to enter full screen mode.QNXStageWebView
   Dispatched when the browser (or plugin) has exited full screen mode.QNXStageWebView
   Signals that the geolocation filter list has been updated.QNXStageWebView
   Dispatched when a call has been made to the qnx.callExtensionMethod function in JavaScript.QNXStageWebView
   Dispatched when a JavaScript exception has occurred.QNXStageWebView
   Dispatched when a long running JavaScript instance has been interrupted.QNXStageWebView
   Dispatched when the result of a executeJavaScript call has been completed.QNXStageWebView
  Indicates that the window location has changed, and returns information about what caused the window to change locations.QNXStageWebView
  Indicates that the window location is changing, and returns information about what caused the window to change locations.QNXStageWebView
   Dispatched when a network resource is requested.QNXStageWebView
   Dispatched when the browser requests that a new QNXStageWebView instance should be opened.QNXStageWebView
   Dispatched when a property of the QNXStageWebView has changed (for any number of reasons).QNXStageWebView
   Dispatched after a textHasAttribute is received.QNXStageWebView
   Dispatched when the text input position (caret) changes.QNXStageWebView
   Dispatched when the selection changes.QNXStageWebView
   Dispatched when an unknown protocol has been requested that could not be handled by networking.QNXStageWebView
   Dispatched when an unknown protocol has been requested that could not be handled by the browser.QNXStageWebView
   Signals that the WebGL filter list has been updated.QNXStageWebView
   Dispatched when a requestSession call has been completed.QNXStageWebView
   Signals that the Window object has been cleared and that scripts may now be optinally injected.QNXStageWebView

Public Constants

 ConstantDefined By
  ISOLATED_WORLD : String = isolatedWorld
[static] Execute javascript in an isolate world.
QNXStageWebView
  NORMAL_WORLD : String = normalWorld
[static] Execute javascript in the page context.
QNXStageWebView
  NO_WORLD : String = noWorld
[static] Execute javascript with no world.
QNXStageWebView
  SECURITY_TYPE_FAILED : String = securityTypeFailed
[static] All certificates failed to be validated.
QNXStageWebView
  SECURITY_TYPE_FULL : String = securityTypeFull
[static] All page resources using valid certificates.
QNXStageWebView
  SECURITY_TYPE_NONE : String = securityTypeNone
[static] No page resources using security.
QNXStageWebView
  SECURITY_TYPE_PARTIAL : String = securityTypePartial
[static] Some page resources using valid certificates.
QNXStageWebView

Property Detail

active


active:Boolean

Determines if the browser is active or inactive.

The default value for this property is true.


Implementation

public function get active():Boolean
public function set active(value:Boolean):void

backgroundColor


backgroundColor:uint

Get and set the background color.


Implementation

public function get backgroundColor():uint
public function set backgroundColor(value:uint):void

blockPopups


blockPopups:Boolean

Determines whether or not to enable the standard browser popup-blocking engine for generic window.open calls from Javascript. When this is enabled, only user requested popups will be allowed.

The default value for this property is true.


Implementation

public function get blockPopups():Boolean
public function set blockPopups(value:Boolean):void

certificateInfo


certificateInfo:CertificateInfo  [read-only]

Retrieves the certificate information for the currently displayed page.


Implementation

public function get certificateInfo():CertificateInfo

contentRectangle


contentRectangle:Rectangle  [read-only]

The rectangle that defines the size of the content of the web page after transformations due to user zoom.


Implementation

public function get contentRectangle():Rectangle

customHTTPHeaders


customHTTPHeaders:Vector.<URLRequestHeader>

Defines custom HTTP headers that are sent in addition to the standard headers.

The default value of this property is nul.


Implementation

public function get customHTTPHeaders():Vector.<URLRequestHeader>
public function set customHTTPHeaders(value:Vector.<URLRequestHeader>):void

defaultFontSize


defaultFontSize:int

Default font size is applied.

This is used to override the default font size for the browser. The range is 1 to 120.

The default value is 16.


Implementation

public function get defaultFontSize():int
public function set defaultFontSize(value:int):void

defaultTextEncoding


defaultTextEncoding:String

The default text encoding if the browser cannot auto-detect the encoding of the page.

The default value of this property is utf-8.


Implementation

public function get defaultTextEncoding():String
public function set defaultTextEncoding(value:String):void

displayDefaultDialogs


displayDefaultDialogs:Boolean  [write-only]

Sets a Boolean that determines if default dialogs will be displayed.


Implementation

public function set displayDefaultDialogs(value:Boolean):void

enableCookies


enableCookies:Boolean

Determines whether or not cookies should be saved and sent back to pages.

The default value of this property is true.


Implementation

public function get enableCookies():Boolean
public function set enableCookies(value:Boolean):void

enableCrossSiteXHR


enableCrossSiteXHR:Boolean

Determines whether or not to allow cross site XHR (XMLHttpRequest).

The default value of this property is true.


Implementation

public function get enableCrossSiteXHR():Boolean
public function set enableCrossSiteXHR(value:Boolean):void

enableDownloadableBinaryFonts


enableDownloadableBinaryFonts:Boolean

Enable or disable downloadable binary fonts.


Implementation

public function get enableDownloadableBinaryFonts():Boolean
public function set enableDownloadableBinaryFonts(value:Boolean):void

enableGeolocation


enableGeolocation:Boolean

Determines whether or not geolocation APIs should be enabled.

The default value of this property is true.


Implementation

public function get enableGeolocation():Boolean
public function set enableGeolocation(value:Boolean):void

enableJavaScript


enableJavaScript:Boolean

Determines whether or not to execute Javascript.

The default value of this property is true.


Implementation

public function get enableJavaScript():Boolean
public function set enableJavaScript(value:Boolean):void

enableLocalAccessToAllCookies


enableLocalAccessToAllCookies:Boolean

Enable or disable access to cookies associated with file: and local: protocols.


Implementation

public function get enableLocalAccessToAllCookies():Boolean
public function set enableLocalAccessToAllCookies(value:Boolean):void

enablePatternMatching


enablePatternMatching:Boolean  [write-only]

Enable or disable pattern matching. By default this is disabled.


Implementation

public function set enablePatternMatching(value:Boolean):void

enablePlugins


enablePlugins:Boolean

Determines whether or not plugins should be enabled.

The default value of this property is true.


Implementation

public function get enablePlugins():Boolean
public function set enablePlugins(value:Boolean):void

enableResourceFiltering


enableResourceFiltering:Boolean

Enables the following events on this webview.

  • qnx.events.NetworkResourceDataReceivedEvent
  • qnx.events.NetworkResourceDoneEvent
  • qnx.events.NetworkResourceHeaderReceivedEvent
  • qnx.events.NetworkResourceOpenedEvent
  • qnx.events.NetworkResourceRequestedEvent
The default value of this property is false.


Implementation

public function get enableResourceFiltering():Boolean
public function set enableResourceFiltering(value:Boolean):void

enableSpatialNavigation


enableSpatialNavigation:Boolean

Enable or disable spatial navigation.


Implementation

public function get enableSpatialNavigation():Boolean
public function set enableSpatialNavigation(value:Boolean):void

enableWebInspector


enableWebInspector:Boolean

Determines whether or not web inspector should be enabled.

The default value of this property is false.


Implementation

public function get enableWebInspector():Boolean
public function set enableWebInspector(value:Boolean):void

enableWebSockets


enableWebSockets:Boolean

Determines whether or not web sockets should be available to pages.

The default value of this property is true.


Implementation

public function get enableWebSockets():Boolean
public function set enableWebSockets(value:Boolean):void

encryptionInfo


encryptionInfo:String  [read-only]

Retrieves the encryption info for the currently displayed page.


Implementation

public function get encryptionInfo():String

favicon


favicon:BitmapData  [read-only]

Gets the favicon for the current page.


Implementation

public function get favicon():BitmapData

forcedTextEncoding


forcedTextEncoding:String

Forced text encoding is applied.

This is used to override a possibly incorrect decision by the browser about the encoding of a page. Set this value to nul to cancel forcedTextEncoding.

The default value is Nul.


Implementation

public function get forcedTextEncoding():String
public function set forcedTextEncoding(value:String):void

historyLength


historyLength:int  [read-only]

The length of the history list.


Implementation

public function get historyLength():int

historyList


historyList:Array  [read-only]

Retrieves a copy of the history list. The history list is an Array of qnx.media.HistoryItem objects. Note that the 0th item is the earliest visited location.


Implementation

public function get historyList():Array

historyPosition


historyPosition:int

The position of the currently active page in the history list. Note that 0 is the back of the list.


Implementation

public function get historyPosition():int
public function set historyPosition(value:int):void

isHistoryBackEnabled


isHistoryBackEnabled:Boolean  [read-only]

Determines whether there is a previous page in the browsing history.


Implementation

public function get isHistoryBackEnabled():Boolean

isHistoryForwardEnabled


isHistoryForwardEnabled:Boolean  [read-only]

Determines whether there is a next page in the browsing history.


Implementation

public function get isHistoryForwardEnabled():Boolean

isSupported


isSupported:Boolean  [read-only]

Determines whether the QNXStageWebView class is supported on the current device.


Implementation

public static function get isSupported():Boolean

javaScriptInterruptTimeout


javaScriptInterruptTimeout:int

Specifies the timeout period (in seconds) after which a long running piece of JavaScript is interrupted. When JavaScript is interrupted, a WebViewEvent.JAVASCRIPT_INTERRUPTED event is fired.

The default value for this property is 60000 (milliseconds).


Implementation

public function get javaScriptInterruptTimeout():int
public function set javaScriptInterruptTimeout(value:int):void

loadImages


loadImages:Boolean

Determines whether or not to load images when the page is loading. If this value is set to false and you decide to to load images, then you must set this flag to true and then reload the page.

The default value for this property is true.


Implementation

public function get loadImages():Boolean
public function set loadImages(value:Boolean):void

loadProgress


loadProgress:int  [read-only]

Retrieves the loading progress of the current page. If the page is fully loaded, this value will remain at 100.


Implementation

public function get loadProgress():int

location


location:String  [read-only]

The URL of the current location.


Implementation

public function get location():String

minimumFontSize


minimumFontSize:int

Get and set the minimum font size. The range is 0 to 120.

The default value is 0.


Implementation

public function get minimumFontSize():int
public function set minimumFontSize(value:int):void

originalLocation


originalLocation:String  [read-only]

The URL of the originally entered location before any redirects.


Implementation

public function get originalLocation():String

overScrollColor


overScrollColor:uint

Get and set the overscroll color.


Implementation

public function get overScrollColor():uint
public function set overScrollColor(value:uint):void

privateBrowsing


privateBrowsing:Boolean

The private browsing flag tells the QNXStageWebView object to enable private browsing mode. Existing cookies are not used and no browsing information is saved.

The default value of this property is false.


Implementation

public function get privateBrowsing():Boolean
public function set privateBrowsing(value:Boolean):void

scroller


scroller:Scroller


Implementation

public function get scroller():Scroller
public function set scroller(value:Scroller):void

scrollPosition


scrollPosition:Point

The current scroll position of the content. If you set a value that extends past the edge of the content, the value will be clamped to the proper value.


Implementation

public function get scrollPosition():Point
public function set scrollPosition(value:Point):void

secureType


secureType:String  [read-only]

Retrieves the security type for the currently displayed page.


Implementation

public function get secureType():String

stage


stage:Stage

The stage on which this QNXStageWebView object is displayed.

Set stage to nul to hide this QNXStageWebView object, or change the visible property to false.

         mySwv = new QNXStageWebView("myBrowser");
         mySwv.stage = this.stage;
         


Implementation

public function get stage():Stage
public function set stage(value:Stage):void

status


status:String  [read-only]

Gets the current status bar content.


Implementation

public function get status():String

textEncoding


textEncoding:String  [read-only]

The current text encoding of the content on the page.

If you have not set a forced text encoding, this value will be either the auto-detected text encoding, or the default text encoding. Otherwise, it is the forced text encoding.


Implementation

public function get textEncoding():String

textReflowMode


textReflowMode:String

Get and set the text reflow mode.


Implementation

public function get textReflowMode():String
public function set textReflowMode(value:String):void

title


title:String  [read-only]

The HTML title value.


Implementation

public function get title():String

tooltip


tooltip:String  [read-only]

Gets the current tool-tip.


Implementation

public function get tooltip():String

userAgent


userAgent:String

The user-agent that is currently reported by the browser to servers during HTTP requests and to web content in scripts.

The default value is system-dependant.


Implementation

public function get userAgent():String
public function set userAgent(value:String):void

userStyleSheet


userStyleSheet:String

Specifies a user stylesheet which overrides the stylesheet that is set by the page. To specify the stylesheet inline, use a data:// URL. Set the url argument to nul to clear the user stylesheet.


Implementation

public function get userStyleSheet():String
public function set userStyleSheet(value:String):void

viewPort


viewPort:Rectangle

The area on the stage in which the QNXStageWebView object is displayed.

         mySwv = new QNXStageWebView("myBrowser");
         mySwv.viewPort = new Rectangle(50,50,400,400);
         


Implementation

public function get viewPort():Rectangle
public function set viewPort(value:Rectangle):void

visible


visible:Boolean

Specifies the visibility property for this QNXStageWebView instance.

The default value for this property is false.


Implementation

public function get visible():Boolean
public function set visible(value:Boolean):void

webInspectorPort


webInspectorPort:int  [read-only]

Get the web inspector port number.


Implementation

public function get webInspectorPort():int

windowUniqueId


windowUniqueId:String  [read-only]

The unique ID of the window.

This value can be used with the qnx.display.IowWindow class to retrieve the underlying window. While you can set any property on the window, you should not resize the viewport as this will cause the QNXStageWebView insatnce to fail. This value is constant through the life of a QNXStageWebView but will be regenerated every time you create a new one.


Implementation

public function get windowUniqueId():String

zoom


zoom:Number

The current zoom factor of the web view.


Implementation

public function get zoom():Number
public function set zoom(value:Number):void

zoomCenter


zoomCenter:Point

The center point of the zoomed area. When this is non-null zooming is done by scaling the existing content without re-rendering. Setting to null causes the content to be rendered at the current zoom factor.


Implementation

public function get zoomCenter():Point
public function set zoomCenter(value:Point):void

zoomToFitWidthOnLoad


zoomToFitWidthOnLoad:Boolean

Determines if the browser will automatically zoom the page to fit the width of the viewport on load.

The default value for this property is true.


Implementation

public function get zoomToFitWidthOnLoad():Boolean
public function set zoomToFitWidthOnLoad(value:Boolean):void

zOrder


zOrder:int

Specifies the z-order of the QNXStageWebView instance with respect to other windows that are children of the stage.

The stage always has a z-order of 0 with respect to children. Windows are painted by the window manager from lowest z-order (backmost) to highest z-order (frontmost). Thus, specifying a value less than 0 will move the QNXStageWebView instance behind the stage (and can be seen through the stage if the stage is not opaque where the QNXStageWebView instance is being displayed). Specifying a value greater than or equal to 0 will move the QNXStageWebView in front of the stage. You must manage the z-order of QNXStageWebView objects if you have more than one, or need to use a special case such as moving behind the stage.

The default value for this property is 0.

In the following listing, the zOrder property of a QNXStageWebView instance is set to -1 (hidden behind the stage) while the class is loading an external URL. When the external content is loaded, the onLoad function is called and the zOrder property is set to 0, which causes the QNXStageWebView to appear in front of the stage and visible to the user.

         mySwv = new QNXStageWebView("myBrowser");
         mySwv.stage = this.stage;
         mySwv.viewPort = new Rectangle(50,50,400,400);
         mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FINISHED, onLoad);
         mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FAILED, onFail);
         mySwv.loadURL("http://www.qnx.com/");
         mySwv.zOrder = -1;

         private function onLoad(e:WebViewEvent):void
         {
             mySwv.zOrder = 0;
         }
         


Implementation

public function get zOrder():int
public function set zOrder(value:int):void

Constructor Detail

QNXStageWebView()


public function QNXStageWebView(name:String, proxy:QNXWebViewProxy = null)

Creates a QNXStageWebView object.

The object is invisible until it is attached to a stage and until the viewPort is set.

Parameters

name:String
proxy:QNXWebViewProxy (default = null)

Method Detail

assignFocus()


public function assignFocus(direction:String = none):void

Assigns focus to the content within this QNXStageWebView object.

Direction values are defined in FocusDirection class and include:

  • bottom
  • none
  • top

Parameters

direction:String (default = none) — A String that specifies whether the first or last focusable object in the displayed content list should receive focus.

clearBrowsingData()


public function clearBrowsingData():void

Clears browsing data.

The following types of data are cleared:

  • Cookies
  • Back-forward history
  • Page-cache
  • Authorizations
  • Local Storage
  • Password data
  • Form data

clearCache()


public function clearCache():void

Clears the browser cache.

clearCookies()


public function clearCookies():void

Clears any cookie information.

clearHistory()


public function clearHistory():void

Clears all browser history.

clearLocalStorage()


public function clearLocalStorage():void

Clears any local storage.

dispose()


public function dispose():void

Disposes of this QNXStageWebView object.

Calling dispose() is optional. If you do not maintain a reference to this QNXStageWebView instance it will be eligible for garbage collection. Calling dispose() can make garbage collection occur sooner, or at a more convenient time.

downloadCancel()


public function downloadCancel(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to cancel a download in the download manager. The download will remain in the download manager until removed.

Parameters

downloadId:uint — The download specified in the event.

downloadPause()


public function downloadPause(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to pause a download in the download manager.

Parameters

downloadId:uint — The download specified in the event.

downloadRemove()


public function downloadRemove(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to remove a download from the download manager. If the download is still in progress it will be cancelled.

Parameters

downloadId:uint — The download specified in the event.

downloadResume()


public function downloadResume(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to resume a paused download in the download manager.

Parameters

downloadId:uint — The download specified in the event.

downloadRetry()


public function downloadRetry(downloadId:uint):void

Used in conjunction with the Downloadevents. Call this function to retry a download in the download manager. If the download is already running it will not be affected.

Parameters

downloadId:uint — The download specified in the event.

downloadUpdate()


public function downloadUpdate(downloadId:uint, action:String, filename:String):void

Used in conjunction with the Downloadevents. Call this function to set the download action to take for a pending download.

Parameters

downloadId:uint — The download specified in the event.
action:String — The action to take from WebDownloadRequestEvent::ACTION_
filename:String — The name to save the file as if the aciton is save. Must not be null or empty.

drawViewPortToBitmapData()


public function drawViewPortToBitmapData(bitmap:BitmapData):void

Draws the QNXStageWebView's view port to a bitmap.

Parameters

bitmap:BitmapData — The BitmapData object on which to draw the visible portion of the QNXStageWebView's view port.


Throws

Error — The bitmap is null.

executeJavaScript()


public function executeJavaScript(script:String):String

Executes the JavaScript code that is specified by script asynchronously.

This function will immediately return a unique identifier for this executeJavaScript() call and JavaScript code block/line. After the code has completed execution (successfully or otherwise) a JavaScriptResultEvent.JAVASCRIPT_RESULT event is fired containing the unique ID of the executeJavaScript() call and the result that was returned (which may be an empty string). Javascript is executed in the NORMAL WORLD

Parameters

script:String — Specifies the block of JavaScript that will be executed.

Returns

String

See also

executeJavaScriptInWorld

executeJavaScriptInWorld()


public function executeJavaScriptInWorld(script:String, world:String):String

Executes the JavaScript code that is specified by script asynchronously.

This function will immediately return a unique identifier for this executeJavaScript() call and JavaScript code block/line. After the code has completed execution (successfully or otherwise) a JavaScriptResultEvent.JAVASCRIPT_RESULT event is fired containing the unique ID of the executeJavaScript() call and the result that was returned (which may be an empty string).

Parameters

script:String — Specifies the block of JavaScript that will be executed.
world:String (default = NaN) — Sepecifies the JavascriptWorld the script will be executed in. The default is the NORMAL_WORLD

Returns

String

findString()


public function findString(string:String, forward:Boolean = true):void

Finds and selects the next/last string that is a case-insensitive match in the web page. It will wrap the web page if it reaches the end. An empty String will result in no match and no selection.

This event will fire a FindStringEvent event after the search iss complete.

Parameters

string:String — The String specifying the text to find.
forward:Boolean (default = true)true if searching forward, or false if backwards.

See also

FindStringEvent

historyBack()


public function historyBack():void

Navigates to the previous page in the browsing history.

historyForward()


public function historyForward():void

Navigates to the next page in the browsing history.

loadFile()


public function loadFile(path:String, overrideContentType:String):void

Loads the page at the specified file path. This function is very similar to calling loadURL with a file: URL, except an override content type can be specified.

Parameters

path:String — The full path of the file to be loaded, prefixed by file://
overrideContentType:String — Optional content type to force WebKit to use

loadString()


public function loadString(text:String, mimeType:String = text/html):void

Loads and displays the specified HTML string.

When the loadString() method is used, the location is reported as "about:blank." Only standard URI schemes can be used in URLs within the HTML string. The AIR URI schemes, "app:" and "app-storage:" are not allowed.

The HTML content cannot load local resources, such as image files. XMLHttpRequests are not allowed.

Only the "text/html" and "application/xhtml+xml" MIME types are supported.

Parameters

text:String — The string of HTML or XHTML content to display.
mimeType:String (default = text/html) — The MIME type of the content, either "text/html" or "application/xhtml+xml".

loadStringWithBase()


public function loadStringWithBase(text:String, baseURL:String, mimeType:String = text/html):void

Loads and displays the specified HTML string with the specified baseURL.

Parameters

text:String — The String of HTML or XHTML content to display.
baseURL:String — The String of the URL that this content is reported to come from.
mimeType:String (default = text/html) — The MIME type of the content.

loadURL()


public function loadURL(url:String):void

Loads the page at the specified URL.

The URL can use the following URI schemes:

  • http:
  • https:
  • file:
  • data:
  • javascript:

Content loaded with the file: scheme can load other local resources.

The following listing loads an external URL.

         mySwv = new QNXStageWebView("myBrowser");
         mySwv.stage = this.stage;
         mySwv.viewPort = new Rectangle(50,50,400,400);
         mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FINISHED, onLoad);
         mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FAILED, onFail);
         mySwv.loadURL("http://www.qnx.com/");
         

Parameters

url:String — The URL of the content to display.

notifyResourceDataReceived()


public function notifyResourceDataReceived(streamId:int, data:ByteArray):void

Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with custom data and headers. Send all data before notifyResourceDone, but after notifyResourceOpened and notifyResourceHeaderReceived. This function simulates data being received from the server.

Parameters

streamId:int — The stream specified in the event.
data:ByteArray — The raw stream of bytes to be loaded by the browser.

notifyResourceDone()


public function notifyResourceDone(streamId:int):void

Used in conjunction with the NetworkResourceDataRequested event to substitue the network stream with custom data and headers. Should only be called last, after notifyResourceOpened notifyResourceHeaderReceived and notifyResourceDataReceived. After this function is called the streamId is no longer valid and should be discarded. This function simulates data being received from the server.

Parameters

streamId:int — The stream specified in the event.

notifyResourceHeaderReceived()


public function notifyResourceHeaderReceived(streamId:int, key:String, value:String):void

Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with custom data and headers. Send all headers before notifyResourceDataReceived and notifyResourceDone, but after notifyResourceOpened. This function simulates the result response from the server.

Parameters

streamId:int — The stream specified in the event.
key:String — The name of the header property.
value:String — The value of the header property.

notifyResourceOpened()


public function notifyResourceOpened(streamId:int, status:int, message:String):void

Used in conjunction with the NetworkResourceDataRequested event to substitute the network stream with a custom response code. Call this function first when substituting. This function simulates the result response from the server.

Parameters

streamId:int — The stream specified in the event.
status:int — The HTTP status code to return to the browser.
message:String — The message to return to the browser.

reload()


public function reload():void

Reloads the current page. You should only invoke reload() when you load your source HTML using loadURL() or loadFile(). The reload() method may throw an error if you loaded your source HTML using loadString() or loadStringWithBase().

removeGeolocationFilter()


public function removeGeolocationFilter(url:String):void

Remove the geolocation filter associated with a url. This will cause the user to be prompted if the site requests geolocation information.

Parameters

url:String

removeWebGLFilter()


public function removeWebGLFilter(url:String):void

Remove the WebGL filter associated with a url. This will cause the user to be prompted if the site uses WebGL.

Parameters

url:String

requestSession()


public function requestSession():void

Request a web session to be saved. A WebSessionInfo event will be dispatched by WebKit to pass up information about the session, so that it can be restored later.

restoreSession()


public function restoreSession(session:String, restoreScrollPosition:Boolean = true, restoreZoomScale:Boolean = true, restoreUrl:Boolean = true):void

Request a web session to be restored.

Parameters

session:String — Information about the session to be restored.
restoreScrollPosition:Boolean (default = true) — Optional parameter to enable restore of scroll position (default: true)
restoreZoomScale:Boolean (default = true) — Optional parameter to enable restore of zoom scale (default: true)
restoreUrl:Boolean (default = true) — Optional parameter to enable restore of url (default: true)

scrollBy()


public function scrollBy(dx:int, dy:int):void

Scroll the content by the specified amount (in pixels).

You may pass negative amounts here. If the amount passed exceeds the edge of the content, the scroll will stop at the edge of the content automatically. This function does not animate the scroll, scroll is moved to the new position as soon as possible.

Parameters

dx:int — The distance to scroll horizontally.
dy:int — The distance to scroll vertically.

setScrolling()


public function setScrolling(scrolling:Boolean):void

Indicate that the web page is being scrolled or is no longer being scrolled. While being scrolled rendering is turned off to ensure it is smooth.

Parameters

scrolling:Boolean — true if the page is being scrolled.

stop()


public function stop():void

Halts the current load operation.

textHasAttribute()


public function textHasAttribute(attribute:String):void

Query the value of a current text attribute. The result of the query will come in the form of a TextAttributeQueryEvent.

Parameters

attribute:String — The name of the attribute to be queried.

updateGeolocationFilter()


public function updateGeolocationFilter(url:String, allow:Boolean):void

Set whether a url is allowed access to geolocation information. If a filter is not set for a site the user is prompted.

Parameters

url:String
allow:Boolean

updateWebGLFilter()


public function updateWebGLFilter(url:String, allow:Boolean):void

Set whether a url is allowed to use WebGL. If a filter is not set for a site the user is prompted.

Parameters

url:String
allow:Boolean

Event Detail

clipboardRead


Event Object Type: qnx.events.ClipboardEvent
ClipboardEvent.type property = qnx.events.ClipboardEvent.CLIPBOARD_READ

clipboardWrite


Event Object Type: qnx.events.ClipboardEvent
ClipboardEvent.type property = qnx.events.ClipboardEvent.CLIPBOARD_WRITE

complete


Event Object Type: flash.events.Event

The Event.COMPLETE constant defines the value of the type property of a complete event object.

contentRendered


Event Object Type: qnx.events.ContentRenderedEvent
ContentRenderedEvent.type property = qnx.events.ContentRenderedEvent.CONTENT_RENDERED

Dispatched when content of the page is re-rendered. The changeRect property of the event indicates the re-rendered rectangle.

created


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.CREATED

Dispatched when the QNXStageWebView object is created.

destroyed


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DESTROYED

Dispatched when the QNXStageWebView object has been destroyed.

documentLoadCommitted


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DOCUMENT_LOAD_COMMITTED

Dispatched when the application receives a response from the server indicating a location change and page load operation. After this event is fired, you must call back to get back to the old page. Calling stop will interrupt the loading of this page, and will leave the page in its state at the time of the stop call.

documentLoaded


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DOCUMENT_LOADED

Dispatched when the javascript document.onload event is fired. This event will be fired after a given timeout period expires, even if the qnx.events.WebViewEvent.DOCUMENT_LOAD_FINISHED event is never fired.

documentLoadFailed


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DOCUMENT_LOAD_FAILED

Dispatched when a document load operation fails.

documentLoadFinished


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.DOCUMENT_LOAD_FINISHED

Dispatched when a document load operation has finished. This event may never be sent as it is possible for a page to never complete loading.

downloadFinished


Event Object Type: qnx.events.WebDownloadFinishedEvent
WebDownloadFinishedEvent.type property = qnx.events.WebDownloadFinishedEvent.DOWNLOAD_FINISHED

Signals that the download has started.

downloadProgress


Event Object Type: qnx.events.WebDownloadProgressEvent
WebDownloadProgressEvent.type property = qnx.events.WebDownloadProgressEvent.DOWNLOAD_PROGRESS

Signals that the download has started.

downloadRequest


Event Object Type: qnx.events.WebDownloadRequestEvent
WebDownloadRequestEvent.type property = qnx.events.WebDownloadRequestEvent.DOWNLOAD_REQUEST

Signals that a download is about to start. You must set the action that you wish to take in response to this event. The default action is to discard the download.

downloadStarted


Event Object Type: qnx.events.WebDownloadStartedEvent
WebDownloadStartedEvent.type property = qnx.events.WebDownloadStartedEvent.DOWNLOAD_STARTED

Signals that the download has started.

error


Event Object Type: qnx.events.NetworkErrorEvent
NetworkErrorEvent.type property = qnx.events.NetworkErrorEvent.ERROR

Indicates that a network error has occurred.

focusIn


Event Object Type: flash.events.FocusEvent

Defines the value of the type property of a focusIn event object.

See also

FOCUS_IN

focusOut


Event Object Type: flash.events.FocusEvent

Defines the value of the type property of a focusOut event object.

See also

FOCUS_OUT

fullScreenEnter


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.FULL_SCREEN_ENTER

Dispatched when the browser (or plugin) has entered full screen mode. You may stop any animations or processes that the user does not need to unload the CPU while the application is in fullscreen mode.

fullScreenEntering


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.FULL_SCREEN_ENTERING

Dispatched when the browser (or plugin) is about to enter full screen mode. Cancel this event to prevent it from entering fullscreen.

fullScreenExit


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.FULL_SCREEN_EXIT

Dispatched when the browser (or plugin) has exited full screen mode.

geolocationFilterUpdated


Event Object Type: qnx.events.WebFilterUpdatedEvent
WebFilterUpdatedEvent.type property = qnx.events.WebFilterUpdatedEvent.GEOLOCATION_FILTER_UPDATED

Signals that the geolocation filter list has been updated.

javaScriptCallback


Event Object Type: qnx.events.JavaScriptCallbackEvent
JavaScriptCallbackEvent.type property = qnx.events.JavaScriptCallbackEvent.JAVA_SCRIPT_CALLBACK

Dispatched when a call has been made to the qnx.callExtensionMethod function in JavaScript. The QNXStageWebView object will automatically return the contents of the result member (default null) unless you cancel this event. In that case you must call sendJavaScriptCallbackReturnValue with the result, the browser will wait and no further javaScriptCallback events will be received until sendJavaScriptCallbackReturnValue is called.

The following listing shows a javascript function (in a web page) that calls the qnx.callExtensionMethod() function:

         <script type="text/javascript">
          function close(){
            qnx.callExtensionMethod("name","val1","val2");
            //must have a parameter or else the event is not thrown, no includes are needed
          }
         </script>

         

Below, a callback function (in an actionscript class) is set up to capture the name and result of the javascript function.

         webview.addEventListener(JavaScriptCallbackEvent.JAVA_SCRIPT_CALLBACK,function(event:JavaScriptCallbackEvent):void{
              trace("callback complete");
              trace("js name: " + event.name);//first parameter that was given
              trace("js result: " + event.result);//null for the moment
              for each(var object:String in event.params){
                  //rest of the parameters
                  trace(object);
              }
         }

         

javaScriptException


Event Object Type: qnx.events.JavaScriptExceptionEvent
JavaScriptExceptionEvent.type property = qnx.events.JavaScriptExceptionEvent.JAVA_SCRIPT_EXCEPTION

Dispatched when a JavaScript exception has occurred. The event contains the exception String, line number, and file where the exception occurred. This event cannot be cancelled.

javaScriptInterrupted


Event Object Type: qnx.events.WebViewEvent
WebViewEvent.type property = qnx.events.WebViewEvent.JAVA_SCRIPT_INTERRUPTED

Dispatched when a long running JavaScript instance has been interrupted. To increase the timeout, set the javaScriptInterruptTimeout property.

javaScriptResult


Event Object Type: qnx.events.JavaScriptResultEvent
JavaScriptResultEvent.type property = qnx.events.JavaScriptResultEvent.JAVA_SCRIPT_RESULT

Dispatched when the result of a executeJavaScript call has been completed. The uniqueId property of the event contains the uniqueId string that was returned from the executeJavaScript call.

locationChange


Event Object Type: qnx.events.ExtendedLocationChangeEvent
ExtendedLocationChangeEvent.type property = qnx.events.ExtendedLocationChangeEvent

Indicates that the window location has changed, and returns information about what caused the window to change locations.

locationChanging


Event Object Type: qnx.events.ExtendedLocationChangeEvent
ExtendedLocationChangeEvent.type property = qnx.events.ExtendedLocationChangeEvent

Indicates that the window location is changing, and returns information about what caused the window to change locations.

networkResourceRequested


Event Object Type: qnx.events.NetworkResourceRequestedEvent
NetworkResourceRequestedEvent.type property = qnx.events.NetworkResourceRequestedEvent.NETWORK_RESOURCE_REQUESTED

Dispatched when a network resource is requested. The URL of the resource is contained in the url property of the event.

Specify the action you wish to take for this resource:

  • NetworkResourceRequestedEvent.ACTION_ACCEPT: (Default) Load the resource.
  • NetworkResourceRequestedEvent.ACTION_DENY: Abort loading this resource.
  • NetworkResourceRequestedEvent.ACTION_FILTER: Filter the resource loading, further events will be received for each stage of the open and data can be substited or monitored at that time.
  • NetworkResourceRequestedEvent.ACTION_SUBSTITUTE: Substitute the entire load with your own data. Must call NetworkResourceOpened, NetworkResourceDone, NetworkResourceHeaderReceived and NetworkResourceDataReceived with the m_streamId in this event.

openWindow


Event Object Type: qnx.events.OpenWindowEvent
OpenWindowEvent.type property = qnx.events.OpenWindowEvent.OPEN_WINDOW

Dispatched when the browser requests that a new QNXStageWebView instance should be opened. The URL property specifies the URL for the QNXStageWebView instance. The name property indicates the name of the window. If a window with the specified name already exists, the window will be reused, otherwise a new window will be created.

propertyChanged


Event Object Type: qnx.events.PropertyChangedEvent
PropertyChangedEvent.type property = qnx.events.PropertyChangedEvent.PROPERTY_CHANGED

Dispatched when a property of the QNXStageWebView has changed (for any number of reasons). The name of the property is stored in the name property of the event.

textAttributeQuery


Event Object Type: qnx.events.TextAttributeQueryEvent
TextAttributeQueryEvent.type property = qnx.events.TextAttributeQueryEvent.TEXT_ATTRIBUTE_QUERY

Dispatched after a textHasAttribute is received. The attribute and value properties of the event contain the results of the query. Note that for many attributes the value string will be either "true" or "false" indicating whether the attribute is present or not. For example, the text attribute "bold" will have a value of "true" or "false", but the attribute "fontName" will have an actual font name as its value. If an attribute is queried which does not exist, its value will be the empty string.

textCaretChanged


Event Object Type: qnx.events.TextCaretChangedEvent
TextCaretChangedEvent.type property = qnx.events.TextCaretChangedEvent.TEXT_CARET_CHANGED

Dispatched when the text input position (caret) changes. The caretRect property of the event indicates the caret position. The userTouch property indicates whether the change was due to user touch input.

textSelectionChanged


Event Object Type: qnx.events.TextSelectionChangedEvent
TextSelectionChangedEvent.type property = qnx.events.TextSelectionChangedEvent.TEXT_SELECTION_CHANGED

Dispatched when the selection changes. The startRect and endRect properties of the event indicate the caret position of the start and end of the selection. NOTE: The selected region is not bounded by these parameters.

unknownProtocol


Event Object Type: qnx.events.UnknownProtocolEvent
UnknownProtocolEvent.type property = qnx.events.UnknownProtocolEvent.UNKNOWN_PROTOCOL

Dispatched when an unknown protocol has been requested that could not be handled by networking. The url property of the event indicates the target URL. The streamId property indicates the stream.

Cancelling this event allows the stream to be filtered using the notifyResourcefunctions. Otherwise, the resource load operation will fail.

unsupportedMimeType


Event Object Type: qnx.events.UnsupportedMimeTypeEvent
UnsupportedMimeTypeEvent.type property = qnx.events.UnsupportedMimeTypeEvent.UNSUPPORTED_MIME_TYPE

Dispatched when an unknown protocol has been requested that could not be handled by the browser.

webGLFilterUpdated


Event Object Type: qnx.events.WebFilterUpdatedEvent
WebFilterUpdatedEvent.type property = qnx.events.WebFilterUpdatedEvent.WEBGL_FILTER_UPDATED

Signals that the WebGL filter list has been updated.

webSessionInfo


Event Object Type: qnx.events.WebSessionInfoEvent
WebSessionInfoEvent.type property = qnx.events.WebSessionInfoEvent.WEB_SESSION_INFO

Dispatched when a requestSession call has been completed. The version property of the event helps in parsing the session data string. The data property is a string containing all required information about a web session, and can be used to identify it uniquely in a restoreSession call.

WindowObjectCleared


Event Object Type: qnx.events.WindowObjectClearedEvent
WindowObjectClearedEvent.type property = qnx.events.WindowObjectClearedEvent.WINDOW_OBJECT_CLEARED

Signals that the Window object has been cleared and that scripts may now be optinally injected. Set the scripts property to the javascript that should be injected and optionally executed.

Constant Detail

ISOLATED_WORLD


public static const ISOLATED_WORLD:String = isolatedWorld

Execute javascript in an isolate world. Scripts execute in a special environment called an isolated world. They have access to the DOM of the page they are injected into, but not to any JavaScript variables or functions created by the page. It looks to each content script as if there is no other JavaScript executing on the page it is running on. The same is true in reverse: JavaScript running on the page cannot call any functions or access any variables defined by content scripts. Isolated worlds allow each content script to make changes to its JavaScript environment without worrying about conflicting with the page or with other content scripts. For example, a content script could include JQuery v1 and the page could include JQuery v2, and they wouldn't conflict with each other.

See also

http://code.google.com/chrome/extensions/content_scripts.html

NO_WORLD


public static const NO_WORLD:String = noWorld

Execute javascript with no world. The javascript will have no access to the DOM.

NORMAL_WORLD


public static const NORMAL_WORLD:String = normalWorld

Execute javascript in the page context. Any variables or functions defined will be available to the page. This is the default behavior of the executeJavaScript call.

SECURITY_TYPE_FAILED


public static const SECURITY_TYPE_FAILED:String = securityTypeFailed

All certificates failed to be validated.

SECURITY_TYPE_FULL


public static const SECURITY_TYPE_FULL:String = securityTypeFull

All page resources using valid certificates.

SECURITY_TYPE_NONE


public static const SECURITY_TYPE_NONE:String = securityTypeNone

No page resources using security.

SECURITY_TYPE_PARTIAL


public static const SECURITY_TYPE_PARTIAL:String = securityTypePartial

Some page resources using valid certificates. Some resources have invalid or no secure connection.

Examples

The following code sample attaches a simple QNXStageWebView instance to the stage. It uses a percentage bar control to alert the user that a page is currently being loaded.
package
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.TimerEvent;
    import flash.geom.Rectangle;
    import flash.utils.Timer;
    import qnx.events.WebViewEvent;
    import qnx.media.QNXStageWebView;
    import qnx.ui.events.
    import qnx.ui.progress.PercentageBar;
    [SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
    public class MyStageWeb extends Sprite
    {
        private var mySwv:QNXStageWebView;
        private var myProgress:PercentageBar;
        private var timer:Timer;
        public function MyStageWeb()
        {
            initializeUI();
        }
        public function initializeUI():void
        {
            timer = new Timer(500);
            timer.addEventListener(TimerEvent.TIMER,handleTimerTick);
            timer.start();
            mySwv = new QNXStageWebView("myBrowser");
            mySwv.stage = this.stage;
            mySwv.viewPort = new Rectangle(50,50,400,400);
            mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FINISHED, onLoad);
            mySwv.addEventListener(WebViewEvent.DOCUMENT_LOAD_FAILED, onFail);
            mySwv.loadURL("http://www.qnx.com/");
            mySwv.scrollBy(100,100);
            mySwv.zoomToFitWidthOnLoad = true;
            mySwv.blockPopups = true;
            mySwv.zOrder = -1;
            myProgress = new PercentageBar();
            myProgress.x = (400-myProgress.width) /2;
            myProgress.y = (500-myProgress.height) /2;
            myProgress.width = 200;
            this.addChild(myProgress);
        }
        private function handleTimerTick(e:Event):void
        {
            myProgress.progress = mySwv.loadProgress/100;
        }
        private function onLoad(e:WebViewEvent):void
        {
            myProgress.progress = 1;
            mySwv.zOrder = 0;
            myProgress.destroy();
        }
        private function onFail(e:WebViewEvent):void
        {
            trace("The document failed to load");
        }
    }
}
     
In the following example, a QNXStageWebView class is attached to the stage to render a String containing HTML markup.
     package
{
    import flash.display.Sprite;
    import flash.geom.Rectangle;
    import qnx.media.QNXStageWebView;
    [SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
    public class myStageWebLocal extends Sprite
    {
        private var MySwv:QNXStageWebView;
        public function myStageWebLocal()
        {
            initializeUI();
        }
        public function initializeUI():void
        {
            var htmlString:String;
            htmlString = "<!DOCTYPE HTML>" +
                "<html>" +
                "<body>" +
                "<h1>Hello World</h1>" +
                "<p>Hello World</p>" +
                "</body>" +
                "</html>";
            trace(htmlString);
            MySwv = new QNXStageWebView("LocalVP");
            MySwv.stage = this.stage;
            MySwv.viewPort = new Rectangle(50,50,400,500);
            MySwv.loadString(htmlString, "text/html");
        }
    }
}