WebView

Description

WebView renders HTML, CSS, and JavaScript content in a prism. When you enable web inspectors in your app, use web inspector clients, such as Chrome DevTools, to debug the displayed WebView content.

Example

⚠️ Don't forget to include the WebView and Internet privileges in your manifest.xml file!
<uses-privilege ml:name="WebView"/>
<uses-privilege ml:name="Internet"/>
import React from "react";
import { View, WebView, Text } from "magic-script-components";
export default class MyApp extends React.Component {
render() {
return (
<View name='main-view' >
<Text text='WebView' textSize={0.05} localPosition={[0, 0.45, 0]} />
<WebView localPosition={[-0.4, 0.4, 0]} width={0.8} height={0.8} url={'http://google.com'}/>
</View>
);
}
}

Common Events

Common Properties

Create Properties

NameTypeDefault ValueDescription
widthnumber0The width of the WebView.
heightnumber0the width of the WebView.

Element Properties

NameTypeDescription
urlstringSets the URL to load in the WebView.
actionstringRequests the specified action.
scrollByvec2Scrolls the WebView in the given direction. Enter an array of two numbers: [xPixels, yPixels]

action options: WebViewAction