From b34d5dd8bfd4e71f239ae1e69bbd3e65d740e564 Mon Sep 17 00:00:00 2001 From: Jesse Pollak Date: Sat, 12 Mar 2016 15:10:28 -0800 Subject: [PATCH] update for demo --- src/components/Container.jsx | 1 + src/lib/extension.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/Container.jsx b/src/components/Container.jsx index 5ee5df0..fa03dea 100644 --- a/src/components/Container.jsx +++ b/src/components/Container.jsx @@ -16,6 +16,7 @@ let Icon = (props) => { } let Version = (props) => { + if (!Extension.isExtension()) return return ( Private beta v{ Extension.getVersion() } diff --git a/src/lib/extension.js b/src/lib/extension.js index 4cfb712..e71ff5b 100644 --- a/src/lib/extension.js +++ b/src/lib/extension.js @@ -1,3 +1,8 @@ +export function isExtension() { + return !!(window.chrome && window.chrome.runtime && window.chrome.runtime.getManifest) +} export function getVersion() { - return chrome.runtime.getManifest().version + if (isExtension()) { + return chrome.runtime.getManifest().version + } }