function createBrowserApiForPrintPreview() {
  let url = window.location.search.substring(1);
  let streamInfo = {
    streamUrl: url,
    originalUrl: url,
    responseHeaders: {},
    embedded: window.parent != window,
    tabId: -1,
  };
  return new Promise(function(resolve, reject) {
           if (!chrome.tabs) {
             resolve();
             return;
           }
           chrome.tabs.getCurrent(function(tab) {
             streamInfo.tabId = tab.id;
             streamInfo.tabUrl = tab.url;
             resolve();
           });
         })
      .then(function() {
        return BrowserApi.create(streamInfo, BrowserApi.ZoomBehavior.NONE);
      });
}
/**
 * Creates a BrowserApi instance for an extension not running as a mime handler.
 *
 * @return {Promise<BrowserApi>} A promise to a BrowserApi instance constructed
 *     from the URL.
 */
Creates a BrowserApi instance for an extension not running as a mime handler.
@return {Promise} A promise to a BrowserApi instance constructed
from the URL.
Creates a BrowserApi instance for an extension not running as a mime handler . @return { Promise } A promise to a BrowserApi instance constructed from the URL .
function createBrowserApiForPrintPreview() {
  let url = window.location.search.substring(1);
  let streamInfo = {
    streamUrl: url,
    originalUrl: url,
    responseHeaders: {},
    embedded: window.parent != window,
    tabId: -1,
  };
  return new Promise(function(resolve, reject) {
           if (!chrome.tabs) {
             resolve();
             return;
           }
           chrome.tabs.getCurrent(function(tab) {
             streamInfo.tabId = tab.id;
             streamInfo.tabUrl = tab.url;
             resolve();
           });
         })
      .then(function() {
        return BrowserApi.create(streamInfo, BrowserApi.ZoomBehavior.NONE);
      });
}
function createBrowserApiForPrintPreview ( ) { let url = window . location . search . substring ( 1 ) ; let streamInfo = { streamUrl : url , originalUrl : url , responseHeaders : { } , embedded : window . parent != window , tabId : - 1 , } ; return new Promise ( function ( resolve , reject ) { if ( ! chrome . tabs ) { resolve ( ) ; return ; } chrome . tabs . getCurrent ( function ( tab ) { streamInfo . tabId = tab . id ; streamInfo . tabUrl = tab . url ; resolve ( ) ; } ) ; } ) . then ( function ( ) { return BrowserApi . create ( streamInfo , BrowserApi . ZoomBehavior . NONE ) ; } ) ; }
Creates a BrowserApi instance for an extension not running as a mime handler.
Creates a BrowserApi instance for an extension not running as a mime handler .