A newer version of Max is available. Click here to access the latest version of the documentation

jweb Reference

Web browser

jweb

Description

The jweb object uses the cross-platform Chromium Embedded Framework (CEF) to view renderable data in a Max box.

Arguments

None.

Attributes

rendermode [int]

Set page rendering style. When set to ‘offscreen’, jweb will first render to an offscreen buffer, then draw to the patcher. This mode is slower, but useful if you need UI elements to appear in front of the jweb object. When set to ‘onscreen’, jweb will render faster, but render directly in the patcher (without using an offscreen buffer) and over any other UI elements. When set to 'onscreen with transparent background', the background of the jweb object will be rendered transparently.

Possible values:

0 = 'Offscreen'
1 = 'Onscreen'
2 = 'Offscreen with Transparent Background'

url [symbol] (default: )

Displays the current URL being displayed.

Common Box Attributes

Messages

anything

You can send any message to the JavaScript of the contained website. In order to be able to receive messages make sure to setup the JavaScript as described in the Communicating with Max from within jweb guide.

back

The word back reloads the previous page of data, functioning like the 'Back' button in a conventional web browser.

executejavascript

Arguments

script [symbol]
Using executejavascript you can inject and run a JavaScript code snippet in the currently displayed website. The provided code will be inserted and executed in a new script tag.

forward

When a sequence of multiple pages has been loaded, and the object has received the back message, the word forward will advance to the following page in the object's page history. forward functions like the 'Forward' button in a conventional web browser.

(mouse)

TEXT_HERE

read

Arguments

url [symbol]
The word read, followed by a symbol that specifies a URL or a file pathname, will read the webpage or file and attempt to render its contents. Upon successful load of a page, two messages are sent from the object's outlet: url, followed the final URL which was loaded based on the provided argument; and title, followed by the title of the loaded page as a symbol.

readfile

Arguments

file path [symbol]
The word readfile, followed by a symbol that specifies a file pathname, will read the file and attempt to render its contents. The word readfile with no argument opens a file dialog to choose a file. Upon successful load of a page, two messages are sent from the object's outlet: url, followed the final URL which was loaded based on the provided argument; and title, followed by the title of the loaded page as a symbol.

reload

The word reload causes the browser to refresh the current page, functioning like the 'Reload' button in a conventional web browser.

See Also

Name Description
Online Resources Online Resources
Communicating with Max from within jweb Communicating with Max from within jweb
js
maxurl
Max JS Tutorial 1: Basic JavaScript Max JS Tutorial 1: Basic JavaScript
Max JS Tutorial 2: JavaScript Scripting Max JS Tutorial 2: JavaScript Scripting
Max JS Tutorial 3: JavaScript Tasks, Arguments, and Globals Max JS Tutorial 3: JavaScript Tasks, Arguments, and Globals