AboutSupportDeveloper GuideVersion 34.118.78.80

Static namespace for OpenFin API methods that interact with the View class, available under fin.View.

Hierarchy

  • Base
    • ViewModule

Accessors

  • get me(): Identity
  • Provides access to the OpenFin representation of the current code context (usually a document such as a View or Window), as well as to the current Interop context.

    Useful for debugging in the devtools console, where this will intelligently type itself based on the context in which the devtools panel was opened.

    Returns Identity

Methods

  • Experimental

    Creates a new View.

    Parameters

    Returns Promise<View>

    Example

    let view;
    async function createView() {
    const me = await fin.Window.getCurrent();
    return fin.View.create({
    name: 'viewNameCreate',
    target: me.identity,
    bounds: {top: 10, left: 10, width: 200, height: 200}
    });
    }

    createView()
    .then((createdView) => {
    view = createdView;
    console.log('View created.', view);
    view.navigate('https://google.com');
    console.log('View navigated to given url.');
    })
    .catch(err => console.log(err));

    Note that created views needs to navigate somewhere for them to actually render a website.

  • Experimental

    Asynchronously returns a View object that represents the current view

    Returns Promise<View>

    Example

    fin.View.getCurrent()
    .then(view => console.log('current view', view))
    .catch(err => console.log(err));
  • Experimental

    Synchronously returns a View object that represents the current view

    Returns View

    Example

    const view = fin.View.getCurrentSync();
    console.log(view);
  • Experimental

    Asynchronously returns a View object that represents an existing view.

    Parameters

    Returns Promise<View>

    Example

    fin.View.wrap({ uuid: 'testViewUuid', name: 'testViewName' }))
    .then(view => console.log('wrapped view', view))
    .catch(err => console.log(err));
  • Experimental

    Synchronously returns a View object that represents an existing view.

    Parameters

    Returns View

    Example

    const view = fin.View.wrapSync({ uuid: 'testView', name: 'testViewName' });
    await view.hide();