summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamran Ahmed <kamranahmed.se@gmail.com>2018-08-30 22:03:04 +0500
committerKamran Ahmed <kamranahmed.se@gmail.com>2018-08-30 22:03:04 +0500
commit12f25b139aa08c5e402b27de9b6a5c3189a6b2c1 (patch)
tree36febbb65279e0e9c4f8110d66c4daf401b4f6c6
parentUpdate build (diff)
downloadgithunt-12f25b139aa08c5e402b27de9b6a5c3189a6b2c1.tar.gz
Update manifest version and ext button switch
-rw-r--r--public/manifest.json4
-rw-r--r--src/components/top-nav/index.js17
2 files changed, 15 insertions, 6 deletions
diff --git a/public/manifest.json b/public/manifest.json
index 09ea19b..137520a 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -3,7 +3,7 @@
"name": "Githunt",
"short_name": "Githunt",
"description": "Replace the new tab with a list of trending repositories on github belonging to any technology that you chose.",
- "version": "2.1",
+ "version": "3",
"permissions": [
"tabs",
"storage",
@@ -18,7 +18,7 @@
"chrome_url_overrides": {
"newtab": "index.html"
},
- "homepage_url": "http://kamranahmed.info/",
+ "homepage_url": "http://kamranahmed.info/githunt",
"browser_action": {
"default_title": "Githunt",
"default_icon": "/img/icon128.png"
diff --git a/src/components/top-nav/index.js b/src/components/top-nav/index.js
index c807698..12f6ec1 100644
--- a/src/components/top-nav/index.js
+++ b/src/components/top-nav/index.js
@@ -7,6 +7,11 @@ class TopNav extends React.Component {
tweet = 'GitHunt – Most starred projects on Github by @kamranahmedse https://github.com/kamranahmedse/githunt';
render() {
+ // We need that to show the extension button only if not running in extension
+ const isRunningExtension = window.chrome &&
+ window.chrome.runtime &&
+ window.chrome.runtime.id;
+
return (
<div className='top-nav'>
<div className="container clearfix">
@@ -25,10 +30,14 @@ class TopNav extends React.Component {
target='_blank'
rel="noopener noreferrer"
className="btn btn-dark"><i className="fa fa-github mr-1"></i> View Source</a>
- <a href='https://goo.gl/e7YP1h'
- target='_blank'
- rel="noopener noreferrer"
- className="btn btn-danger"><i className="fa fa-chrome mr-1"></i> Use Extension</a>
+ {
+ !isRunningExtension && (
+ <a href='https://goo.gl/e7YP1h'
+ target='_blank'
+ rel="noopener noreferrer"
+ className="btn btn-danger"><i className="fa fa-chrome mr-1"></i> Use Extension</a>
+ )
+ }
<a href={ `https://twitter.com/intent/tweet?text=${this.tweet}` }
target='_blank'
rel="noopener noreferrer"