1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Scripts for the message handler for use with WKWebView.
7 goog
.provide('__crWeb.messageDynamic');
10 * Namespace for this module.
12 __gCrWeb
.message_dynamic
= {};
14 /* Beginning of anonymous object. */
17 * Sends queued commands to the Objective-C side.
18 * @param {Object} queueObject Queue object containing messages to send.
20 __gCrWeb
.message_dynamic
.sendQueue = function(queueObject
) {
21 queueObject
.queue
.forEach(function(command
) {
22 var stringifiedMessage
= __gCrWeb
.common
.JSONStringify({
23 "crwCommand": command
,
24 "crwWindowId": __gCrWeb
.windowId
26 window
.webkit
.messageHandlers
[queueObject
.scheme
].postMessage(