{"action":"created","comment":{"url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/comments/48047194","id":48047194,"diff_hunk":"@@ -0,0 +1,38 @@\n+function runShowMeTheCode(tabId, tab) {\n+    function isGitHub(tab) {\n+        return urlMatches(tab, /https:\\/\\/github\\.com\\/.*/)\n+    };\n+\n+    function isBlobView(tab) {\n+        return urlMatches(tab, /.*\\/blob\\/.*/);\n+    };\n+\n+    function pullRequestFileView(tab) {\n+        return urlMatches(tab, /.*\\/pull\\/.*\\/files/);\n+    };\n+\n+    function urlMatches(tab, expression) {\n+        return tab.url && tab.url.match(expression);\n+    }\n+\n+    function insertCSS(fileName) {\n+        chrome.tabs.insertCSS(tabId, {file: fileName});\n+    };\n+\n+    if (isGitHub(tab)) {\n+        if (isBlobView(tab) || pullRequestFileView(tab)) {\n+            insertCSS('showMeTheCode.css');\n+        } else {\n+            insertCSS('disableShowMeTheCode.css');","path":"src/background.js","position":26,"original_position":26,"commit_id":"fc19750401f8f55e62e107a94034e82587b2b6af","original_commit_id":"fc19750401f8f55e62e107a94034e82587b2b6af","user":{"login":"balawama","id":3935659,"avatar_url":"https://avatars.githubusercontent.com/u/3935659?v=3","gravatar_id":"","url":"https://api.github.com/users/balawama","html_url":"https://github.com/balawama","followers_url":"https://api.github.com/users/balawama/followers","following_url":"https://api.github.com/users/balawama/following{/other_user}","gists_url":"https://api.github.com/users/balawama/gists{/gist_id}","starred_url":"https://api.github.com/users/balawama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balawama/subscriptions","organizations_url":"https://api.github.com/users/balawama/orgs","repos_url":"https://api.github.com/users/balawama/repos","events_url":"https://api.github.com/users/balawama/events{/privacy}","received_events_url":"https://api.github.com/users/balawama/received_events","type":"User","site_admin":false},"body":"How can we achieve that? Page is not being reloaded and our CSS stays loaded\n18 gru 2015 6:12 PM \"Łukasz Nowak\" <notifications@github.com> napisał(a):\n\n> In src/background.js\n> <https://github.com/Viridovix/show-me-the-code-github/pull/32#discussion_r48046976>\n> :\n>\n> > +        return urlMatches(tab, /.*\\/pull\\/.*\\/files/);\n> > +    };\n> > +\n> > +    function urlMatches(tab, expression) {\n> > +        return tab.url && tab.url.match(expression);\n> > +    }\n> > +\n> > +    function insertCSS(fileName) {\n> > +        chrome.tabs.insertCSS(tabId, {file: fileName});\n> > +    };\n> > +\n> > +    if (isGitHub(tab)) {\n> > +        if (isBlobView(tab) || pullRequestFileView(tab)) {\n> > +            insertCSS('showMeTheCode.css');\n> > +        } else {\n> > +            insertCSS('disableShowMeTheCode.css');\n>\n> Can't we use original style?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/Viridovix/show-me-the-code-github/pull/32/files#r48046976>\n> .\n>\n","created_at":"2015-12-18T17:13:50Z","updated_at":"2015-12-18T17:13:50Z","html_url":"https://github.com/Viridovix/show-me-the-code-github/pull/32#discussion_r48047194","pull_request_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/comments/48047194"},"html":{"href":"https://github.com/Viridovix/show-me-the-code-github/pull/32#discussion_r48047194"},"pull_request":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/32","id":53047757,"html_url":"https://github.com/Viridovix/show-me-the-code-github/pull/32","diff_url":"https://github.com/Viridovix/show-me-the-code-github/pull/32.diff","patch_url":"https://github.com/Viridovix/show-me-the-code-github/pull/32.patch","issue_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues/32","number":32,"state":"open","locked":false,"title":"#30 Page is no longer need to be reloaded in order to apply CSS","user":{"login":"balawama","id":3935659,"avatar_url":"https://avatars.githubusercontent.com/u/3935659?v=3","gravatar_id":"","url":"https://api.github.com/users/balawama","html_url":"https://github.com/balawama","followers_url":"https://api.github.com/users/balawama/followers","following_url":"https://api.github.com/users/balawama/following{/other_user}","gists_url":"https://api.github.com/users/balawama/gists{/gist_id}","starred_url":"https://api.github.com/users/balawama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balawama/subscriptions","organizations_url":"https://api.github.com/users/balawama/orgs","repos_url":"https://api.github.com/users/balawama/repos","events_url":"https://api.github.com/users/balawama/events{/privacy}","received_events_url":"https://api.github.com/users/balawama/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-08T22:21:27Z","updated_at":"2015-12-18T17:13:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b7da87709a64a40e92233da1eeb5e8929adc7be","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/32/commits","review_comments_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/32/comments","review_comment_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues/32/comments","statuses_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/statuses/fc19750401f8f55e62e107a94034e82587b2b6af","head":{"label":"Viridovix:#30_no_reload_needed","ref":"#30_no_reload_needed","sha":"fc19750401f8f55e62e107a94034e82587b2b6af","user":{"login":"Viridovix","id":15159912,"avatar_url":"https://avatars.githubusercontent.com/u/15159912?v=3","gravatar_id":"","url":"https://api.github.com/users/Viridovix","html_url":"https://github.com/Viridovix","followers_url":"https://api.github.com/users/Viridovix/followers","following_url":"https://api.github.com/users/Viridovix/following{/other_user}","gists_url":"https://api.github.com/users/Viridovix/gists{/gist_id}","starred_url":"https://api.github.com/users/Viridovix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Viridovix/subscriptions","organizations_url":"https://api.github.com/users/Viridovix/orgs","repos_url":"https://api.github.com/users/Viridovix/repos","events_url":"https://api.github.com/users/Viridovix/events{/privacy}","received_events_url":"https://api.github.com/users/Viridovix/received_events","type":"Organization","site_admin":false},"repo":{"id":44408663,"name":"show-me-the-code-github","full_name":"Viridovix/show-me-the-code-github","owner":{"login":"Viridovix","id":15159912,"avatar_url":"https://avatars.githubusercontent.com/u/15159912?v=3","gravatar_id":"","url":"https://api.github.com/users/Viridovix","html_url":"https://github.com/Viridovix","followers_url":"https://api.github.com/users/Viridovix/followers","following_url":"https://api.github.com/users/Viridovix/following{/other_user}","gists_url":"https://api.github.com/users/Viridovix/gists{/gist_id}","starred_url":"https://api.github.com/users/Viridovix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Viridovix/subscriptions","organizations_url":"https://api.github.com/users/Viridovix/orgs","repos_url":"https://api.github.com/users/Viridovix/repos","events_url":"https://api.github.com/users/Viridovix/events{/privacy}","received_events_url":"https://api.github.com/users/Viridovix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Viridovix/show-me-the-code-github","description":"Talk is cheap. Show me the code my dear GitHub! ","fork":false,"url":"https://api.github.com/repos/Viridovix/show-me-the-code-github","forks_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/forks","keys_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/teams","hooks_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/hooks","issue_events_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues/events{/number}","events_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/events","assignees_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/assignees{/user}","branches_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/branches{/branch}","tags_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/tags","blobs_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/refs{/sha}","trees_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/statuses/{sha}","languages_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/languages","stargazers_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/stargazers","contributors_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/contributors","subscribers_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/subscribers","subscription_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/subscription","commits_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/commits{/sha}","git_commits_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/commits{/sha}","comments_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/comments{/number}","issue_comment_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues/comments{/number}","contents_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/contents/{+path}","compare_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/merges","archive_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/downloads","issues_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues{/number}","pulls_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls{/number}","milestones_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/milestones{/number}","notifications_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/labels{/name}","releases_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/releases{/id}","created_at":"2015-10-16T20:22:30Z","updated_at":"2015-11-10T22:32:53Z","pushed_at":"2015-12-10T21:39:37Z","git_url":"git://github.com/Viridovix/show-me-the-code-github.git","ssh_url":"git@github.com:Viridovix/show-me-the-code-github.git","clone_url":"https://github.com/Viridovix/show-me-the-code-github.git","svn_url":"https://github.com/Viridovix/show-me-the-code-github","homepage":null,"size":63,"stargazers_count":3,"watchers_count":3,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":3,"default_branch":"master"}},"base":{"label":"Viridovix:master","ref":"master","sha":"e52de1867c9e0be5fda91097cfe89576fc053e0b","user":{"login":"Viridovix","id":15159912,"avatar_url":"https://avatars.githubusercontent.com/u/15159912?v=3","gravatar_id":"","url":"https://api.github.com/users/Viridovix","html_url":"https://github.com/Viridovix","followers_url":"https://api.github.com/users/Viridovix/followers","following_url":"https://api.github.com/users/Viridovix/following{/other_user}","gists_url":"https://api.github.com/users/Viridovix/gists{/gist_id}","starred_url":"https://api.github.com/users/Viridovix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Viridovix/subscriptions","organizations_url":"https://api.github.com/users/Viridovix/orgs","repos_url":"https://api.github.com/users/Viridovix/repos","events_url":"https://api.github.com/users/Viridovix/events{/privacy}","received_events_url":"https://api.github.com/users/Viridovix/received_events","type":"Organization","site_admin":false},"repo":{"id":44408663,"name":"show-me-the-code-github","full_name":"Viridovix/show-me-the-code-github","owner":{"login":"Viridovix","id":15159912,"avatar_url":"https://avatars.githubusercontent.com/u/15159912?v=3","gravatar_id":"","url":"https://api.github.com/users/Viridovix","html_url":"https://github.com/Viridovix","followers_url":"https://api.github.com/users/Viridovix/followers","following_url":"https://api.github.com/users/Viridovix/following{/other_user}","gists_url":"https://api.github.com/users/Viridovix/gists{/gist_id}","starred_url":"https://api.github.com/users/Viridovix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Viridovix/subscriptions","organizations_url":"https://api.github.com/users/Viridovix/orgs","repos_url":"https://api.github.com/users/Viridovix/repos","events_url":"https://api.github.com/users/Viridovix/events{/privacy}","received_events_url":"https://api.github.com/users/Viridovix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Viridovix/show-me-the-code-github","description":"Talk is cheap. Show me the code my dear GitHub! ","fork":false,"url":"https://api.github.com/repos/Viridovix/show-me-the-code-github","forks_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/forks","keys_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/teams","hooks_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/hooks","issue_events_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues/events{/number}","events_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/events","assignees_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/assignees{/user}","branches_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/branches{/branch}","tags_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/tags","blobs_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/refs{/sha}","trees_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/statuses/{sha}","languages_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/languages","stargazers_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/stargazers","contributors_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/contributors","subscribers_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/subscribers","subscription_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/subscription","commits_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/commits{/sha}","git_commits_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/git/commits{/sha}","comments_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/comments{/number}","issue_comment_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues/comments{/number}","contents_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/contents/{+path}","compare_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/merges","archive_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/downloads","issues_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues{/number}","pulls_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls{/number}","milestones_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/milestones{/number}","notifications_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/labels{/name}","releases_url":"https://api.github.com/repos/Viridovix/show-me-the-code-github/releases{/id}","created_at":"2015-10-16T20:22:30Z","updated_at":"2015-11-10T22:32:53Z","pushed_at":"2015-12-10T21:39:37Z","git_url":"git://github.com/Viridovix/show-me-the-code-github.git","ssh_url":"git@github.com:Viridovix/show-me-the-code-github.git","clone_url":"https://github.com/Viridovix/show-me-the-code-github.git","svn_url":"https://github.com/Viridovix/show-me-the-code-github","homepage":null,"size":63,"stargazers_count":3,"watchers_count":3,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/32"},"html":{"href":"https://github.com/Viridovix/show-me-the-code-github/pull/32"},"issue":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues/32"},"comments":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/Viridovix/show-me-the-code-github/statuses/fc19750401f8f55e62e107a94034e82587b2b6af"}}}}