Tutorial: window.getInfo

window.getInfo

Gets basic window information.

Response

The response is packaged in a windowInfo object, which looks something like this:

{
    url: '...',                  // properly formatted Uniform Resource Locator
    title: '...',                // page title appearing in title bar of window
    canNavigateForward: false,   // indicates if window history can navigate forward one page
    canNavigateBack: false,      // indicates if window history can navigate back one page
    plugins: [{                  // an array of all final plugin module states
        ...,                     // original plugin's properties set in the manifest
        state: 'load-failed'|    // plugin module failed to load
               'failed'|         // plugin module failed to eval
               'succeeded'       // plugin module eval'ed successfully
    }, ...],
    preloadScripts: [{           // an array of all final preload scripts' states
        ...,                     // original preload script's properties
        state: 'load-failed'|    // preload script failed to load
               'failed'|         // preload script failed to eval
               'succeeded'       // preload script eval'ed successfully
    }, ...]
}

Example

var finWindow = fin.desktop.Window.getCurrent();

finWindow.getInfo(info => {
    console.log('Window URL: ', info.url);
    console.log('Window title: ', info.title);
});