Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: chrome/third_party/chromevox/chromevox/injected/mathjax.js

Issue 2295863002: Remove window.postMessage(message, transferables, targetOrigin) legacy overload (Closed)
Patch Set: leave milestoneString alone Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Bridge to MathJax functions from the ChromeVox content script. 6 * @fileoverview Bridge to MathJax functions from the ChromeVox content script.
7 * 7 *
8 */ 8 */
9 9
10 if (typeof(goog) != 'undefined' && goog.provide) { 10 if (typeof(goog) != 'undefined' && goog.provide) {
(...skipping 20 matching lines...) Expand all
31 }; 31 };
32 32
33 33
34 /** 34 /**
35 * Initializes message channel in Chromevox. 35 * Initializes message channel in Chromevox.
36 */ 36 */
37 cvox.MathJax.initMessage = function() { 37 cvox.MathJax.initMessage = function() {
38 channel_.port1.onmessage = function(evt) { 38 channel_.port1.onmessage = function(evt) {
39 cvox.MathJax.execMessage(evt.data); 39 cvox.MathJax.execMessage(evt.data);
40 }; 40 };
41 window.postMessage('cvox.MathJaxPortSetup', [channel_.port2], '*'); 41 window.postMessage('cvox.MathJaxPortSetup', '*', [channel_.port2]);
42 }; 42 };
43 43
44 44
45 /** 45 /**
46 * Post a message to Chromevox. 46 * Post a message to Chromevox.
47 * @param {string} cmd The command to be executed in Chromevox. 47 * @param {string} cmd The command to be executed in Chromevox.
48 * @param {string} callbackId A string representing the callback id. 48 * @param {string} callbackId A string representing the callback id.
49 * @param {Object<string, *>} args Dictionary of arguments. 49 * @param {Object<string, *>} args Dictionary of arguments.
50 */ 50 */
51 cvox.MathJax.postMessage = function(cmd, callbackId, args) { 51 cvox.MathJax.postMessage = function(cmd, callbackId, args) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 cvox.MathJax.postMessage( 179 cvox.MathJax.postMessage(
180 'Active', callbackId, 180 'Active', callbackId,
181 {'status': cvox.MathJaxExternalUtil.isActive()}); 181 {'status': cvox.MathJaxExternalUtil.isActive()});
182 }; 182 };
183 183
184 184
185 // Initializing the bridge. 185 // Initializing the bridge.
186 cvox.MathJax.initMessage(); 186 cvox.MathJax.initMessage();
187 187
188 })(); 188 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698