function askWebviewToFindWindowByName(webview, name, callback) {
  var messageHandler = new Messaging.Handler();
  // Listen for 'FIND_WINDOW_BY_NAME_COMPLETE'
  messageHandler.addHandler(
      FIND_WINDOW_BY_NAME_COMPLETE,
      function(message, port) {
        // Remove this handler since it is no longer needed.
        messageHandler.removeHandler(FIND_WINDOW_BY_NAME_COMPLETE);
        callback(message.found);
      });
  // Send the request to set the window name.
  messageHandler.sendMessage(
      new Messaging.Message(FIND_WINDOW_BY_NAME, {windowName: name}),
      webview.contentWindow);
}
// |callback| will be called with a boolean |found| argument upon completion.
|callback| will be called with a boolean |found| argument upon completion.
|callback| will be called with a boolean |found| argument upon completion .
function askWebviewToFindWindowByName(webview, name, callback) {
  var messageHandler = new Messaging.Handler();
  messageHandler.addHandler(
      FIND_WINDOW_BY_NAME_COMPLETE,
      function(message, port) {
        messageHandler.removeHandler(FIND_WINDOW_BY_NAME_COMPLETE);
        callback(message.found);
      });
  messageHandler.sendMessage(
      new Messaging.Message(FIND_WINDOW_BY_NAME, {windowName: name}),
      webview.contentWindow);
}
function askWebviewToFindWindowByName ( webview , name , callback ) { var messageHandler = new Messaging . Handler ( ) ; messageHandler . addHandler ( FIND_WINDOW_BY_NAME_COMPLETE , function ( message , port ) { messageHandler . removeHandler ( FIND_WINDOW_BY_NAME_COMPLETE ) ; callback ( message . found ) ; } ) ; messageHandler . sendMessage ( new Messaging . Message ( FIND_WINDOW_BY_NAME , { windowName : name } ) , webview . contentWindow ) ; }
|callback| will be called with a boolean |found| argument upon completion.
|callback| will be called with a boolean |found| argument upon completion .
// Listen for 'FIND_WINDOW_BY_NAME_COMPLETE' // Remove this handler since it is no longer needed. // Send the request to set the window name.