{"action":"created","comment":{"url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/comments/40533304","id":40533304,"diff_hunk":"@@ -96,11 +96,43 @@ function onClickHandler (info, tab) {\n   }\n }\n \n+function disableButton (tabId) {\n+  chrome.browserAction.setIcon({path: '/icons/gyazo-38-gray.png'})\n+  chrome.browserAction.disable(tabId)\n+}\n+\n+function enableButton (tabId) {\n+  chrome.browserAction.setIcon({path: '/icons/gyazo-38.png'})\n+  chrome.browserAction.enable(tabId)\n+}\n+\n+chrome.tabs.onActivated.addListener(function (activeInfo) {\n+  chrome.tabs.get(activeInfo.tabId, function (tab) {\n+    if (tab.status === 'loading') {\n+      return disableButton(tab.id)\n+    }\n+    if (tab.url.match(/^https?:/)) {\n+      enableButton(tab.id)\n+    } else {\n+      disableButton(tab.id)\n+    }\n+  })\n+})\n+\n chrome.tabs.onUpdated.addListener(function (tabId, changeInfo) {\n-  if (changeInfo.status === 'complete') {\n-    chrome.tabs.executeScript(tabId, {\n-      file: './content.js'\n-    }, function () {})\n+  if (changeInfo.status === 'loading') {\n+    disableButton(tabId)","path":"main.js","position":33,"original_position":33,"commit_id":"040c8464221f256a9b14d03ee56af839373cff01","original_commit_id":"040c8464221f256a9b14d03ee56af839373cff01","user":{"login":"rakusai","id":52566,"avatar_url":"https://avatars.githubusercontent.com/u/52566?v=3","gravatar_id":"","url":"https://api.github.com/users/rakusai","html_url":"https://github.com/rakusai","followers_url":"https://api.github.com/users/rakusai/followers","following_url":"https://api.github.com/users/rakusai/following{/other_user}","gists_url":"https://api.github.com/users/rakusai/gists{/gist_id}","starred_url":"https://api.github.com/users/rakusai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakusai/subscriptions","organizations_url":"https://api.github.com/users/rakusai/orgs","repos_url":"https://api.github.com/users/rakusai/repos","events_url":"https://api.github.com/users/rakusai/events{/privacy}","received_events_url":"https://api.github.com/users/rakusai/received_events","type":"User","site_admin":false},"body":"Do not need this?","created_at":"2015-09-28T09:33:56Z","updated_at":"2015-09-28T09:33:56Z","html_url":"https://github.com/gyazo/gyazo-chrome-extension/pull/73#discussion_r40533304","pull_request_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/comments/40533304"},"html":{"href":"https://github.com/gyazo/gyazo-chrome-extension/pull/73#discussion_r40533304"},"pull_request":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/73","id":46122128,"html_url":"https://github.com/gyazo/gyazo-chrome-extension/pull/73","diff_url":"https://github.com/gyazo/gyazo-chrome-extension/pull/73.diff","patch_url":"https://github.com/gyazo/gyazo-chrome-extension/pull/73.patch","issue_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues/73","number":73,"state":"open","locked":false,"title":"show message on chrome internal URLs","user":{"login":"pastak","id":191533,"avatar_url":"https://avatars.githubusercontent.com/u/191533?v=3","gravatar_id":"","url":"https://api.github.com/users/pastak","html_url":"https://github.com/pastak","followers_url":"https://api.github.com/users/pastak/followers","following_url":"https://api.github.com/users/pastak/following{/other_user}","gists_url":"https://api.github.com/users/pastak/gists{/gist_id}","starred_url":"https://api.github.com/users/pastak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pastak/subscriptions","organizations_url":"https://api.github.com/users/pastak/orgs","repos_url":"https://api.github.com/users/pastak/repos","events_url":"https://api.github.com/users/pastak/events{/privacy}","received_events_url":"https://api.github.com/users/pastak/received_events","type":"User","site_admin":false},"body":"[![Gyazo](https://bot.gyazo.com/3cf3d8e473aa71159d13123615b2488d.png)](https://gyazo.com/3cf3d8e473aa71159d13123615b2488d)","created_at":"2015-09-28T05:47:09Z","updated_at":"2015-09-28T09:33:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0dafd49757c542a467478a868f3460094b9d2c9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/73/commits","review_comments_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/73/comments","review_comment_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues/73/comments","statuses_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/statuses/040c8464221f256a9b14d03ee56af839373cff01","head":{"label":"gyazo:dont-show-alert-on-chromeurls","ref":"dont-show-alert-on-chromeurls","sha":"040c8464221f256a9b14d03ee56af839373cff01","user":{"login":"gyazo","id":140548,"avatar_url":"https://avatars.githubusercontent.com/u/140548?v=3","gravatar_id":"","url":"https://api.github.com/users/gyazo","html_url":"https://github.com/gyazo","followers_url":"https://api.github.com/users/gyazo/followers","following_url":"https://api.github.com/users/gyazo/following{/other_user}","gists_url":"https://api.github.com/users/gyazo/gists{/gist_id}","starred_url":"https://api.github.com/users/gyazo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyazo/subscriptions","organizations_url":"https://api.github.com/users/gyazo/orgs","repos_url":"https://api.github.com/users/gyazo/repos","events_url":"https://api.github.com/users/gyazo/events{/privacy}","received_events_url":"https://api.github.com/users/gyazo/received_events","type":"Organization","site_admin":false},"repo":{"id":21933359,"name":"gyazo-chrome-extension","full_name":"gyazo/gyazo-chrome-extension","owner":{"login":"gyazo","id":140548,"avatar_url":"https://avatars.githubusercontent.com/u/140548?v=3","gravatar_id":"","url":"https://api.github.com/users/gyazo","html_url":"https://github.com/gyazo","followers_url":"https://api.github.com/users/gyazo/followers","following_url":"https://api.github.com/users/gyazo/following{/other_user}","gists_url":"https://api.github.com/users/gyazo/gists{/gist_id}","starred_url":"https://api.github.com/users/gyazo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyazo/subscriptions","organizations_url":"https://api.github.com/users/gyazo/orgs","repos_url":"https://api.github.com/users/gyazo/repos","events_url":"https://api.github.com/users/gyazo/events{/privacy}","received_events_url":"https://api.github.com/users/gyazo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gyazo/gyazo-chrome-extension","description":"Gyazo Extension allows you to capture and send image links faster than anything else.","fork":false,"url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension","forks_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/forks","keys_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/teams","hooks_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/hooks","issue_events_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues/events{/number}","events_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/events","assignees_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/assignees{/user}","branches_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/branches{/branch}","tags_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/tags","blobs_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/languages","stargazers_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/stargazers","contributors_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/contributors","subscribers_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/subscribers","subscription_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/subscription","commits_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/contents/{+path}","compare_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/merges","archive_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/downloads","issues_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues{/number}","pulls_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/labels{/name}","releases_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/releases{/id}","created_at":"2014-07-17T07:53:01Z","updated_at":"2015-09-25T12:45:15Z","pushed_at":"2015-09-28T09:29:47Z","git_url":"git://github.com/gyazo/gyazo-chrome-extension.git","ssh_url":"git@github.com:gyazo/gyazo-chrome-extension.git","clone_url":"https://github.com/gyazo/gyazo-chrome-extension.git","svn_url":"https://github.com/gyazo/gyazo-chrome-extension","homepage":null,"size":1870,"stargazers_count":30,"watchers_count":30,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":4,"forks":9,"open_issues":4,"watchers":30,"default_branch":"master"}},"base":{"label":"gyazo:master","ref":"master","sha":"9674b3172ee21c03204a172ce6c21ea6511a6e28","user":{"login":"gyazo","id":140548,"avatar_url":"https://avatars.githubusercontent.com/u/140548?v=3","gravatar_id":"","url":"https://api.github.com/users/gyazo","html_url":"https://github.com/gyazo","followers_url":"https://api.github.com/users/gyazo/followers","following_url":"https://api.github.com/users/gyazo/following{/other_user}","gists_url":"https://api.github.com/users/gyazo/gists{/gist_id}","starred_url":"https://api.github.com/users/gyazo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyazo/subscriptions","organizations_url":"https://api.github.com/users/gyazo/orgs","repos_url":"https://api.github.com/users/gyazo/repos","events_url":"https://api.github.com/users/gyazo/events{/privacy}","received_events_url":"https://api.github.com/users/gyazo/received_events","type":"Organization","site_admin":false},"repo":{"id":21933359,"name":"gyazo-chrome-extension","full_name":"gyazo/gyazo-chrome-extension","owner":{"login":"gyazo","id":140548,"avatar_url":"https://avatars.githubusercontent.com/u/140548?v=3","gravatar_id":"","url":"https://api.github.com/users/gyazo","html_url":"https://github.com/gyazo","followers_url":"https://api.github.com/users/gyazo/followers","following_url":"https://api.github.com/users/gyazo/following{/other_user}","gists_url":"https://api.github.com/users/gyazo/gists{/gist_id}","starred_url":"https://api.github.com/users/gyazo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyazo/subscriptions","organizations_url":"https://api.github.com/users/gyazo/orgs","repos_url":"https://api.github.com/users/gyazo/repos","events_url":"https://api.github.com/users/gyazo/events{/privacy}","received_events_url":"https://api.github.com/users/gyazo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gyazo/gyazo-chrome-extension","description":"Gyazo Extension allows you to capture and send image links faster than anything else.","fork":false,"url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension","forks_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/forks","keys_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/teams","hooks_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/hooks","issue_events_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues/events{/number}","events_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/events","assignees_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/assignees{/user}","branches_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/branches{/branch}","tags_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/tags","blobs_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/languages","stargazers_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/stargazers","contributors_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/contributors","subscribers_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/subscribers","subscription_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/subscription","commits_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/contents/{+path}","compare_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/merges","archive_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/downloads","issues_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues{/number}","pulls_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/labels{/name}","releases_url":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/releases{/id}","created_at":"2014-07-17T07:53:01Z","updated_at":"2015-09-25T12:45:15Z","pushed_at":"2015-09-28T09:29:47Z","git_url":"git://github.com/gyazo/gyazo-chrome-extension.git","ssh_url":"git@github.com:gyazo/gyazo-chrome-extension.git","clone_url":"https://github.com/gyazo/gyazo-chrome-extension.git","svn_url":"https://github.com/gyazo/gyazo-chrome-extension","homepage":null,"size":1870,"stargazers_count":30,"watchers_count":30,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":4,"forks":9,"open_issues":4,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/73"},"html":{"href":"https://github.com/gyazo/gyazo-chrome-extension/pull/73"},"issue":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues/73"},"comments":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/gyazo/gyazo-chrome-extension/statuses/040c8464221f256a9b14d03ee56af839373cff01"}}}}