Skip to main content

WebViewOptions

Class

WebViewOptions allow you to specify various aspects of the WebView that will be created.

  • Available on all platforms
4 platform notes
  • SnapchatFully supported
    • Experimental API; it may change or be removed.
  • SPECSFully supported
    • Experimental API; it may change or be removed.
  • Camera Kit WebFully supported
    • Experimental API; it may change or be removed.
  • Camera Kit MobileFully supported
    • Experimental API; it may change or be removed.

Platform details

  • Snapchat — Fully supported. Experimental API; it may change or be removed

  • SPECS — Fully supported. Experimental API; it may change or be removed

  • Camera Kit Web — Fully supported. Experimental API; it may change or be removed

  • Camera Kit Mobile — Fully supported. Experimental API; it may change or be removed

Experimental

WebViewOptions allow you to specify various aspects of the WebView that will be created. These are only used at creation time.

Index

Example

// Create the options
var resolution = new vec2(512, 512);
var options = InternetModule.createWebViewOptions(resolution);
options.policy.allow = [ "snap.com", "snapchat.com" ];
options.policy.block = [ "fakesnap.com" ];
const resolution = new vec2(512,512);
const options = InternetModule.createWebViewOptions(resolution);

Extends

Properties

requestPolicy

readonly requestPolicy: WebViewPolicy

Experimental

Allows the ability to set various web request policies.


resolution

resolution: vec2

Experimental

The resolution of the WebView that was requested. Units are in pixels.

Note: This resolution is unrelated to the device resolution. Note: This does not change the scale or dimensions of the RenderMeshVisual that is used to draw the WebView.

Tip: For best results choose a resolution that best matches your expected aspect ratio and desired responsive size of web content. This can not be changed later without creating a new WebView instance.

Default Value

(0, 0)
@experimental

Methods

getTypeName()

static getTypeName(): TypeName<WebViewOptions>

Experimental

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<WebViewOptions>

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Experimental

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Experimental

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Experimental

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame

See also

InternetModule#createWebViewOptions