From 136caa2034e151763347d20488f2516277631bc9 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 12 Apr 2018 14:39:28 -0700 Subject: Add JSDocs Page and Script Includes new script `npm run doc` for generating docs page. --- docs/jsdocs/platforms_extension.js.html | 117 ++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 docs/jsdocs/platforms_extension.js.html (limited to 'docs/jsdocs/platforms_extension.js.html') diff --git a/docs/jsdocs/platforms_extension.js.html b/docs/jsdocs/platforms_extension.js.html new file mode 100644 index 000000000..c75f6c108 --- /dev/null +++ b/docs/jsdocs/platforms_extension.js.html @@ -0,0 +1,117 @@ + + + + + + + platforms/extension.js - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

platforms/extension.js

+ + + + + + + +
+
+
const extension = require('extensionizer')
+
+/**
+ * An object that provides a variety of platform-specific functions.
+ *
+ * @typedef {object} Platform
+ *
+ * @property {Function} reload - A function to reload the application.
+ * @property {Function} openWindow - Opens a URL in the web browser.
+ * @property {Function} getVersion - Gets the current version of MetaMask.
+ * @property {Function} openExtensionInBrowser - Opens the MetaMask UI in a full window.
+ * @property {Function} getPlatformInfo - Callback function that returns info about the current platform.
+ */
+
+class ExtensionPlatform {
+
+  //
+  // Public
+  //
+  reload () {
+    extension.runtime.reload()
+  }
+
+  openWindow ({ url }) {
+    extension.tabs.create({ url })
+  }
+
+  getVersion () {
+    return extension.runtime.getManifest().version
+  }
+
+  openExtensionInBrowser () {
+    const extensionURL = extension.runtime.getURL('home.html')
+    this.openWindow({ url: extensionURL })
+  }
+
+  getPlatformInfo (cb) {
+    try {
+      extension.runtime.getPlatformInfo((platform) => {
+        cb(null, platform)
+      })
+    } catch (e) {
+      cb(e)
+    }
+  }
+}
+
+module.exports = ExtensionPlatform
+
+
+
+ + + + +
+ +
+ + + + + + + + -- cgit