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

Unified Diff: remoting/webapp/remoting.js

Issue 9564029: [Chromoting] Log extension name and version number on startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove locale Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/remoting.js
diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js
index b536190526c9275f68a927341ec463e6ca1d3be3..33d0cc82474b4e1dc796f27a194520a3d167a4c4 100644
--- a/remoting/webapp/remoting.js
+++ b/remoting/webapp/remoting.js
@@ -29,6 +29,7 @@ remoting.Error = {
* Entry point for app initialization.
*/
remoting.init = function() {
+ remoting.logExtensionInfoAsync_();
l10n.localize();
var button = document.getElementById('toggle-scaling');
button.title = chrome.i18n.getMessage(/*i18n-content*/'TOOLTIP_SCALING');
@@ -76,6 +77,23 @@ remoting.init = function() {
};
/**
+ * Log information about the current extension.
+ * The extension manifest is loaded and parsed to extract this info.
+ */
+remoting.logExtensionInfoAsync_ = function() {
+ /** @type {XMLHttpRequest} */
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', 'manifest.json');
+ xhr.onload = function(e) {
+ var manifest =
+ /** @type {{name: string, version: string, default_locale: string}} */
+ JSON.parse(xhr.responseText);
+ console.log(manifest.name + ' version: ' + manifest.version);
+ }
+ xhr.send(null);
+};
+
+/**
* If the client is connected, or the host is shared, prompt before closing.
*
* @return {?string} The prompt string if a connection is active.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698