function initialize() {
  var messageHandler = Messaging.GetHandler();
  // Handler to set the cookies as requested.
  messageHandler.addHandler(SET_COOKIE, function(message, portFrom) {
    document.cookie = getCookieExpiringTomorrow(message.cookie);
    messageHandler.sendMessage(new Messaging.Message(SET_COOKIE_COMPLETE, {}),
        portFrom);
  });
  // Handler to send the cookies to the requester.
  messageHandler.addHandler(GET_COOKIES, function(message, portFrom) {
    messageHandler.sendMessage(
        new Messaging.Message(
            GET_COOKIES_COMPLETE, {cookies: getCookiesFromDocument()}),
        portFrom);
  });
}
// handled include commands from the app window to set and get cookies.
handled include commands from the app window to set and get cookies.
handled include commands from the app window to set and get cookies .
function initialize() {
  var messageHandler = Messaging.GetHandler();
  messageHandler.addHandler(SET_COOKIE, function(message, portFrom) {
    document.cookie = getCookieExpiringTomorrow(message.cookie);
    messageHandler.sendMessage(new Messaging.Message(SET_COOKIE_COMPLETE, {}),
        portFrom);
  });
  messageHandler.addHandler(GET_COOKIES, function(message, portFrom) {
    messageHandler.sendMessage(
        new Messaging.Message(
            GET_COOKIES_COMPLETE, {cookies: getCookiesFromDocument()}),
        portFrom);
  });
}
function initialize ( ) { var messageHandler = Messaging . GetHandler ( ) ; messageHandler . addHandler ( SET_COOKIE , function ( message , portFrom ) { document . cookie = getCookieExpiringTomorrow ( message . cookie ) ; messageHandler . sendMessage ( new Messaging . Message ( SET_COOKIE_COMPLETE , { } ) , portFrom ) ; } ) ; messageHandler . addHandler ( GET_COOKIES , function ( message , portFrom ) { messageHandler . sendMessage ( new Messaging . Message ( GET_COOKIES_COMPLETE , { cookies : getCookiesFromDocument ( ) } ) , portFrom ) ; } ) ; }
handled include commands from the app window to set and get cookies.
handled include commands from the app window to set and get cookies .
// Handler to set the cookies as requested. // Handler to send the cookies to the requester.