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
    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);
});