{"action":"created","comment":{"url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/comments/27084089","id":27084089,"diff_hunk":"@@ -13,33 +13,51 @@ let getHost = require('./util/get-host');\n  * Constants.\n  */\n \n-const PRODUCT_HUNT_HOST = process.env.PRODUCT_HUNT_HOST;\n+const BAR_DISABLED_KEY = process.env.BAR_DISABLED_KEY;\n \n /**\n  * Locals.\n  */\n \n-let referrer = getHost(document.referrer);\n-let currentHost = location.host;\n-let detector = new Detector(PRODUCT_HUNT_HOST, currentHost, referrer);\n-\n-// check if we should show the product bar\n-// on the current page\n-if (detector.enable()) {\n-  debug('showing product bar...');\n-  let containerEl = document.createElement('div');\n-\n-  // insert the container\n-  document.body.insertBefore(containerEl, document.body.firstChild)\n-\n-  // render the product bar\n-  React.render(\n-    <ProductBar />,\n-    containerEl\n-  );\n-\n-  // fetch the product data\n-  api.getProduct(location.href);\n-} else {\n-  debug('not showing product bar...');\n+let detector = new Detector;\n+\n+/**\n+ * Render the product bar.\n+ *\n+ * @private\n+ */\n+\n+function render() {\n+  // check if we should show the product bar\n+  // on the current page\n+  if (detector.enable(location.search)) {\n+    debug('showing product bar...');\n+    let containerEl = document.createElement('div');\n+\n+    // insert the container\n+    document.body.insertBefore(containerEl, document.body.firstChild)\n+\n+    // render the product bar\n+    React.render(\n+      <ProductBar />,\n+      containerEl\n+    );\n+\n+    // fetch the product data\n+    api.getProduct(location.href);\n+  } else {\n+    debug('not showing product bar...');\n+  }\n }\n+\n+let option = {};\n+option[BAR_DISABLED_KEY] = false;\n+\n+chrome.storage.sync.get(option, function(items) {","path":"src/apps/content/main.js","position":68,"original_position":68,"commit_id":"eb50564aa62d206d2fcd0db125e793d0e71eca25","original_commit_id":"eb50564aa62d206d2fcd0db125e793d0e71eca25","user":{"login":"andreasklinger","id":245833,"avatar_url":"https://avatars.githubusercontent.com/u/245833?v=3","gravatar_id":"","url":"https://api.github.com/users/andreasklinger","html_url":"https://github.com/andreasklinger","followers_url":"https://api.github.com/users/andreasklinger/followers","following_url":"https://api.github.com/users/andreasklinger/following{/other_user}","gists_url":"https://api.github.com/users/andreasklinger/gists{/gist_id}","starred_url":"https://api.github.com/users/andreasklinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreasklinger/subscriptions","organizations_url":"https://api.github.com/users/andreasklinger/orgs","repos_url":"https://api.github.com/users/andreasklinger/repos","events_url":"https://api.github.com/users/andreasklinger/events{/privacy}","received_events_url":"https://api.github.com/users/andreasklinger/received_events","type":"User","site_admin":false},"body":"option*s* ?","created_at":"2015-03-24T23:35:39Z","updated_at":"2015-03-24T23:35:39Z","html_url":"https://github.com/producthunt/producthunt-chrome-extension/pull/6#discussion_r27084089","pull_request_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/comments/27084089"},"html":{"href":"https://github.com/producthunt/producthunt-chrome-extension/pull/6#discussion_r27084089"},"pull_request":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/6","id":31431628,"html_url":"https://github.com/producthunt/producthunt-chrome-extension/pull/6","diff_url":"https://github.com/producthunt/producthunt-chrome-extension/pull/6.diff","patch_url":"https://github.com/producthunt/producthunt-chrome-extension/pull/6.patch","issue_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues/6","number":6,"state":"open","locked":false,"title":"General fixes & polishing","user":{"login":"vesln","id":330048,"avatar_url":"https://avatars.githubusercontent.com/u/330048?v=3","gravatar_id":"","url":"https://api.github.com/users/vesln","html_url":"https://github.com/vesln","followers_url":"https://api.github.com/users/vesln/followers","following_url":"https://api.github.com/users/vesln/following{/other_user}","gists_url":"https://api.github.com/users/vesln/gists{/gist_id}","starred_url":"https://api.github.com/users/vesln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vesln/subscriptions","organizations_url":"https://api.github.com/users/vesln/orgs","repos_url":"https://api.github.com/users/vesln/repos","events_url":"https://api.github.com/users/vesln/events{/privacy}","received_events_url":"https://api.github.com/users/vesln/received_events","type":"User","site_admin":false},"body":"## Scope\r\n\r\n- Make the vote button in the default tab look like it cannot be clicked (lukas)\r\n- Remove the fade in effect in the default tab (rado)\r\n- The header link now points to \"http\" not \"https\" (ryan)\r\n- Fix the shadow of the Product Pane (ryan)\r\n- Make the product pane wider (ryan)\r\n- Remove padding/margin from the popup window (ryan)\r\n- Replace FB like with FB share (ryan)\r\n- Fix the styling of the close button (ryan)\r\n- Make the PH widget wider (ryan)\r\n- Show loading indicator when opening the product details (andreas)\r\n\r\n## Notes\r\n\r\nNone","created_at":"2015-03-18T14:08:31Z","updated_at":"2015-03-24T23:35:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"762e72b580b4483203b3570330f4ce24a603276f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/6/commits","review_comments_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/6/comments","review_comment_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/comments{/number}","comments_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues/6/comments","statuses_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/statuses/eb50564aa62d206d2fcd0db125e793d0e71eca25","head":{"label":"producthunt:fix/polish","ref":"fix/polish","sha":"eb50564aa62d206d2fcd0db125e793d0e71eca25","user":{"login":"producthunt","id":6935003,"avatar_url":"https://avatars.githubusercontent.com/u/6935003?v=3","gravatar_id":"","url":"https://api.github.com/users/producthunt","html_url":"https://github.com/producthunt","followers_url":"https://api.github.com/users/producthunt/followers","following_url":"https://api.github.com/users/producthunt/following{/other_user}","gists_url":"https://api.github.com/users/producthunt/gists{/gist_id}","starred_url":"https://api.github.com/users/producthunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/producthunt/subscriptions","organizations_url":"https://api.github.com/users/producthunt/orgs","repos_url":"https://api.github.com/users/producthunt/repos","events_url":"https://api.github.com/users/producthunt/events{/privacy}","received_events_url":"https://api.github.com/users/producthunt/received_events","type":"Organization","site_admin":false},"repo":{"id":22711552,"name":"producthunt-chrome-extension","full_name":"producthunt/producthunt-chrome-extension","owner":{"login":"producthunt","id":6935003,"avatar_url":"https://avatars.githubusercontent.com/u/6935003?v=3","gravatar_id":"","url":"https://api.github.com/users/producthunt","html_url":"https://github.com/producthunt","followers_url":"https://api.github.com/users/producthunt/followers","following_url":"https://api.github.com/users/producthunt/following{/other_user}","gists_url":"https://api.github.com/users/producthunt/gists{/gist_id}","starred_url":"https://api.github.com/users/producthunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/producthunt/subscriptions","organizations_url":"https://api.github.com/users/producthunt/orgs","repos_url":"https://api.github.com/users/producthunt/repos","events_url":"https://api.github.com/users/producthunt/events{/privacy}","received_events_url":"https://api.github.com/users/producthunt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/producthunt/producthunt-chrome-extension","description":"Chrome Extension for Product Hunt","fork":false,"url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension","forks_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/forks","keys_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/teams","hooks_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/hooks","issue_events_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues/events{/number}","events_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/events","assignees_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/assignees{/user}","branches_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/branches{/branch}","tags_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/tags","blobs_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/languages","stargazers_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/stargazers","contributors_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/contributors","subscribers_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/subscribers","subscription_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/subscription","commits_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/contents/{+path}","compare_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/merges","archive_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/downloads","issues_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues{/number}","pulls_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/labels{/name}","releases_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/releases{/id}","created_at":"2014-08-07T06:51:55Z","updated_at":"2015-03-18T08:31:35Z","pushed_at":"2015-03-24T09:17:06Z","git_url":"git://github.com/producthunt/producthunt-chrome-extension.git","ssh_url":"git@github.com:producthunt/producthunt-chrome-extension.git","clone_url":"https://github.com/producthunt/producthunt-chrome-extension.git","svn_url":"https://github.com/producthunt/producthunt-chrome-extension","homepage":null,"size":732,"stargazers_count":13,"watchers_count":13,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":13,"default_branch":"master"}},"base":{"label":"producthunt:master","ref":"master","sha":"45b30fa2b58410148eb76950833a21bd166a23c3","user":{"login":"producthunt","id":6935003,"avatar_url":"https://avatars.githubusercontent.com/u/6935003?v=3","gravatar_id":"","url":"https://api.github.com/users/producthunt","html_url":"https://github.com/producthunt","followers_url":"https://api.github.com/users/producthunt/followers","following_url":"https://api.github.com/users/producthunt/following{/other_user}","gists_url":"https://api.github.com/users/producthunt/gists{/gist_id}","starred_url":"https://api.github.com/users/producthunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/producthunt/subscriptions","organizations_url":"https://api.github.com/users/producthunt/orgs","repos_url":"https://api.github.com/users/producthunt/repos","events_url":"https://api.github.com/users/producthunt/events{/privacy}","received_events_url":"https://api.github.com/users/producthunt/received_events","type":"Organization","site_admin":false},"repo":{"id":22711552,"name":"producthunt-chrome-extension","full_name":"producthunt/producthunt-chrome-extension","owner":{"login":"producthunt","id":6935003,"avatar_url":"https://avatars.githubusercontent.com/u/6935003?v=3","gravatar_id":"","url":"https://api.github.com/users/producthunt","html_url":"https://github.com/producthunt","followers_url":"https://api.github.com/users/producthunt/followers","following_url":"https://api.github.com/users/producthunt/following{/other_user}","gists_url":"https://api.github.com/users/producthunt/gists{/gist_id}","starred_url":"https://api.github.com/users/producthunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/producthunt/subscriptions","organizations_url":"https://api.github.com/users/producthunt/orgs","repos_url":"https://api.github.com/users/producthunt/repos","events_url":"https://api.github.com/users/producthunt/events{/privacy}","received_events_url":"https://api.github.com/users/producthunt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/producthunt/producthunt-chrome-extension","description":"Chrome Extension for Product Hunt","fork":false,"url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension","forks_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/forks","keys_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/teams","hooks_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/hooks","issue_events_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues/events{/number}","events_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/events","assignees_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/assignees{/user}","branches_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/branches{/branch}","tags_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/tags","blobs_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/languages","stargazers_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/stargazers","contributors_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/contributors","subscribers_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/subscribers","subscription_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/subscription","commits_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/contents/{+path}","compare_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/merges","archive_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/downloads","issues_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues{/number}","pulls_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/labels{/name}","releases_url":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/releases{/id}","created_at":"2014-08-07T06:51:55Z","updated_at":"2015-03-18T08:31:35Z","pushed_at":"2015-03-24T09:17:06Z","git_url":"git://github.com/producthunt/producthunt-chrome-extension.git","ssh_url":"git@github.com:producthunt/producthunt-chrome-extension.git","clone_url":"https://github.com/producthunt/producthunt-chrome-extension.git","svn_url":"https://github.com/producthunt/producthunt-chrome-extension","homepage":null,"size":732,"stargazers_count":13,"watchers_count":13,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/6"},"html":{"href":"https://github.com/producthunt/producthunt-chrome-extension/pull/6"},"issue":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues/6"},"comments":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/producthunt/producthunt-chrome-extension/statuses/eb50564aa62d206d2fcd0db125e793d0e71eca25"}}}}