{"action":"created","comment":{"url":"https://api.github.com/repos/privly/privly-applications/pulls/comments/34725450","id":34725450,"diff_hunk":"@@ -425,10 +425,14 @@ if (Privly === undefined) {\n   SafariAdapter.prototype.getContextName = function () {\n     if (window.document.getElementById('is-background-script') !== null) {\n       return 'BACKGROUND_SCRIPT';\n-    } else if (window.location.href.indexOf(window.location.origin + '/privly-applications') === 0) {\n-      return 'PRIVLY_APPLICATION';\n     } else {\n-      return 'CONTENT_SCRIPT';\n+      var pathname = window.location.pathname.split('/')[1];\n+      var window_location = window.location.origin + '/' + pathname + '/privly-applications';\n+      if (window.location.href.toLowerCase().indexOf(window_location) === 0) {","path":"shared/javascripts/context_messenger.js","position":10,"original_position":10,"commit_id":"7fe296a229bbcbf89f44de92211af4a442eef5d7","original_commit_id":"7fe296a229bbcbf89f44de92211af4a442eef5d7","user":{"login":"smcgregor","id":64780,"avatar_url":"https://avatars.githubusercontent.com/u/64780?v=3","gravatar_id":"","url":"https://api.github.com/users/smcgregor","html_url":"https://github.com/smcgregor","followers_url":"https://api.github.com/users/smcgregor/followers","following_url":"https://api.github.com/users/smcgregor/following{/other_user}","gists_url":"https://api.github.com/users/smcgregor/gists{/gist_id}","starred_url":"https://api.github.com/users/smcgregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smcgregor/subscriptions","organizations_url":"https://api.github.com/users/smcgregor/orgs","repos_url":"https://api.github.com/users/smcgregor/repos","events_url":"https://api.github.com/users/smcgregor/events{/privacy}","received_events_url":"https://api.github.com/users/smcgregor/received_events","type":"User","site_admin":false},"body":"Could you change this to `window.location.href.indexOf(\"safari://\") === 0`?","created_at":"2015-07-15T20:32:38Z","updated_at":"2015-07-15T20:32:38Z","html_url":"https://github.com/privly/privly-applications/pull/271#discussion_r34725450","pull_request_url":"https://api.github.com/repos/privly/privly-applications/pulls/271","_links":{"self":{"href":"https://api.github.com/repos/privly/privly-applications/pulls/comments/34725450"},"html":{"href":"https://github.com/privly/privly-applications/pull/271#discussion_r34725450"},"pull_request":{"href":"https://api.github.com/repos/privly/privly-applications/pulls/271"}}},"pull_request":{"url":"https://api.github.com/repos/privly/privly-applications/pulls/271","id":39951530,"html_url":"https://github.com/privly/privly-applications/pull/271","diff_url":"https://github.com/privly/privly-applications/pull/271.diff","patch_url":"https://github.com/privly/privly-applications/pull/271.patch","issue_url":"https://api.github.com/repos/privly/privly-applications/issues/271","number":271,"state":"open","locked":false,"title":"Send message from PRIVLY_APPLICATION to CONTENT_SCRIPT","user":{"login":"sammyshj","id":4390022,"avatar_url":"https://avatars.githubusercontent.com/u/4390022?v=3","gravatar_id":"","url":"https://api.github.com/users/sammyshj","html_url":"https://github.com/sammyshj","followers_url":"https://api.github.com/users/sammyshj/followers","following_url":"https://api.github.com/users/sammyshj/following{/other_user}","gists_url":"https://api.github.com/users/sammyshj/gists{/gist_id}","starred_url":"https://api.github.com/users/sammyshj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sammyshj/subscriptions","organizations_url":"https://api.github.com/users/sammyshj/orgs","repos_url":"https://api.github.com/users/sammyshj/repos","events_url":"https://api.github.com/users/sammyshj/events{/privacy}","received_events_url":"https://api.github.com/users/sammyshj/received_events","type":"User","site_admin":false},"body":"Changes done in the PR:\r\n* Does not send message from `CONTENT_SCRIPT` to `CONTENT_SCRIPT` anymore. This is because, the variable `safari.application.activeBrowserWindow.tabs` is not defined when the context of the script is the `CONTENT_SCRIPT`.","created_at":"2015-07-14T19:16:38Z","updated_at":"2015-07-15T20:32:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9065f6a39748a49d8a9d5ab6ee4538a37db51913","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/privly/privly-applications/pulls/271/commits","review_comments_url":"https://api.github.com/repos/privly/privly-applications/pulls/271/comments","review_comment_url":"https://api.github.com/repos/privly/privly-applications/pulls/comments{/number}","comments_url":"https://api.github.com/repos/privly/privly-applications/issues/271/comments","statuses_url":"https://api.github.com/repos/privly/privly-applications/statuses/7fe296a229bbcbf89f44de92211af4a442eef5d7","head":{"label":"sammyshj:safariadapter","ref":"safariadapter","sha":"7fe296a229bbcbf89f44de92211af4a442eef5d7","user":{"login":"sammyshj","id":4390022,"avatar_url":"https://avatars.githubusercontent.com/u/4390022?v=3","gravatar_id":"","url":"https://api.github.com/users/sammyshj","html_url":"https://github.com/sammyshj","followers_url":"https://api.github.com/users/sammyshj/followers","following_url":"https://api.github.com/users/sammyshj/following{/other_user}","gists_url":"https://api.github.com/users/sammyshj/gists{/gist_id}","starred_url":"https://api.github.com/users/sammyshj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sammyshj/subscriptions","organizations_url":"https://api.github.com/users/sammyshj/orgs","repos_url":"https://api.github.com/users/sammyshj/repos","events_url":"https://api.github.com/users/sammyshj/events{/privacy}","received_events_url":"https://api.github.com/users/sammyshj/received_events","type":"User","site_admin":false},"repo":{"id":31703455,"name":"privly-applications","full_name":"sammyshj/privly-applications","owner":{"login":"sammyshj","id":4390022,"avatar_url":"https://avatars.githubusercontent.com/u/4390022?v=3","gravatar_id":"","url":"https://api.github.com/users/sammyshj","html_url":"https://github.com/sammyshj","followers_url":"https://api.github.com/users/sammyshj/followers","following_url":"https://api.github.com/users/sammyshj/following{/other_user}","gists_url":"https://api.github.com/users/sammyshj/gists{/gist_id}","starred_url":"https://api.github.com/users/sammyshj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sammyshj/subscriptions","organizations_url":"https://api.github.com/users/sammyshj/orgs","repos_url":"https://api.github.com/users/sammyshj/repos","events_url":"https://api.github.com/users/sammyshj/events{/privacy}","received_events_url":"https://api.github.com/users/sammyshj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sammyshj/privly-applications","description":"The central repository for Privly Injectable Applications.","fork":true,"url":"https://api.github.com/repos/sammyshj/privly-applications","forks_url":"https://api.github.com/repos/sammyshj/privly-applications/forks","keys_url":"https://api.github.com/repos/sammyshj/privly-applications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sammyshj/privly-applications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sammyshj/privly-applications/teams","hooks_url":"https://api.github.com/repos/sammyshj/privly-applications/hooks","issue_events_url":"https://api.github.com/repos/sammyshj/privly-applications/issues/events{/number}","events_url":"https://api.github.com/repos/sammyshj/privly-applications/events","assignees_url":"https://api.github.com/repos/sammyshj/privly-applications/assignees{/user}","branches_url":"https://api.github.com/repos/sammyshj/privly-applications/branches{/branch}","tags_url":"https://api.github.com/repos/sammyshj/privly-applications/tags","blobs_url":"https://api.github.com/repos/sammyshj/privly-applications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sammyshj/privly-applications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sammyshj/privly-applications/git/refs{/sha}","trees_url":"https://api.github.com/repos/sammyshj/privly-applications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sammyshj/privly-applications/statuses/{sha}","languages_url":"https://api.github.com/repos/sammyshj/privly-applications/languages","stargazers_url":"https://api.github.com/repos/sammyshj/privly-applications/stargazers","contributors_url":"https://api.github.com/repos/sammyshj/privly-applications/contributors","subscribers_url":"https://api.github.com/repos/sammyshj/privly-applications/subscribers","subscription_url":"https://api.github.com/repos/sammyshj/privly-applications/subscription","commits_url":"https://api.github.com/repos/sammyshj/privly-applications/commits{/sha}","git_commits_url":"https://api.github.com/repos/sammyshj/privly-applications/git/commits{/sha}","comments_url":"https://api.github.com/repos/sammyshj/privly-applications/comments{/number}","issue_comment_url":"https://api.github.com/repos/sammyshj/privly-applications/issues/comments{/number}","contents_url":"https://api.github.com/repos/sammyshj/privly-applications/contents/{+path}","compare_url":"https://api.github.com/repos/sammyshj/privly-applications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sammyshj/privly-applications/merges","archive_url":"https://api.github.com/repos/sammyshj/privly-applications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sammyshj/privly-applications/downloads","issues_url":"https://api.github.com/repos/sammyshj/privly-applications/issues{/number}","pulls_url":"https://api.github.com/repos/sammyshj/privly-applications/pulls{/number}","milestones_url":"https://api.github.com/repos/sammyshj/privly-applications/milestones{/number}","notifications_url":"https://api.github.com/repos/sammyshj/privly-applications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sammyshj/privly-applications/labels{/name}","releases_url":"https://api.github.com/repos/sammyshj/privly-applications/releases{/id}","created_at":"2015-03-05T08:25:41Z","updated_at":"2015-03-05T08:25:42Z","pushed_at":"2015-07-15T20:28:00Z","git_url":"git://github.com/sammyshj/privly-applications.git","ssh_url":"git@github.com:sammyshj/privly-applications.git","clone_url":"https://github.com/sammyshj/privly-applications.git","svn_url":"https://github.com/sammyshj/privly-applications","homepage":null,"size":7229,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"privly:gsoc-develop","ref":"gsoc-develop","sha":"85ecce49cfcf7efb5e9ff50ff23fbb7ba549077f","user":{"login":"privly","id":1761186,"avatar_url":"https://avatars.githubusercontent.com/u/1761186?v=3","gravatar_id":"","url":"https://api.github.com/users/privly","html_url":"https://github.com/privly","followers_url":"https://api.github.com/users/privly/followers","following_url":"https://api.github.com/users/privly/following{/other_user}","gists_url":"https://api.github.com/users/privly/gists{/gist_id}","starred_url":"https://api.github.com/users/privly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privly/subscriptions","organizations_url":"https://api.github.com/users/privly/orgs","repos_url":"https://api.github.com/users/privly/repos","events_url":"https://api.github.com/users/privly/events{/privacy}","received_events_url":"https://api.github.com/users/privly/received_events","type":"Organization","site_admin":false},"repo":{"id":9557677,"name":"privly-applications","full_name":"privly/privly-applications","owner":{"login":"privly","id":1761186,"avatar_url":"https://avatars.githubusercontent.com/u/1761186?v=3","gravatar_id":"","url":"https://api.github.com/users/privly","html_url":"https://github.com/privly","followers_url":"https://api.github.com/users/privly/followers","following_url":"https://api.github.com/users/privly/following{/other_user}","gists_url":"https://api.github.com/users/privly/gists{/gist_id}","starred_url":"https://api.github.com/users/privly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privly/subscriptions","organizations_url":"https://api.github.com/users/privly/orgs","repos_url":"https://api.github.com/users/privly/repos","events_url":"https://api.github.com/users/privly/events{/privacy}","received_events_url":"https://api.github.com/users/privly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/privly/privly-applications","description":"The central repository for Privly Injectable Applications.","fork":false,"url":"https://api.github.com/repos/privly/privly-applications","forks_url":"https://api.github.com/repos/privly/privly-applications/forks","keys_url":"https://api.github.com/repos/privly/privly-applications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privly/privly-applications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privly/privly-applications/teams","hooks_url":"https://api.github.com/repos/privly/privly-applications/hooks","issue_events_url":"https://api.github.com/repos/privly/privly-applications/issues/events{/number}","events_url":"https://api.github.com/repos/privly/privly-applications/events","assignees_url":"https://api.github.com/repos/privly/privly-applications/assignees{/user}","branches_url":"https://api.github.com/repos/privly/privly-applications/branches{/branch}","tags_url":"https://api.github.com/repos/privly/privly-applications/tags","blobs_url":"https://api.github.com/repos/privly/privly-applications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privly/privly-applications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privly/privly-applications/git/refs{/sha}","trees_url":"https://api.github.com/repos/privly/privly-applications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privly/privly-applications/statuses/{sha}","languages_url":"https://api.github.com/repos/privly/privly-applications/languages","stargazers_url":"https://api.github.com/repos/privly/privly-applications/stargazers","contributors_url":"https://api.github.com/repos/privly/privly-applications/contributors","subscribers_url":"https://api.github.com/repos/privly/privly-applications/subscribers","subscription_url":"https://api.github.com/repos/privly/privly-applications/subscription","commits_url":"https://api.github.com/repos/privly/privly-applications/commits{/sha}","git_commits_url":"https://api.github.com/repos/privly/privly-applications/git/commits{/sha}","comments_url":"https://api.github.com/repos/privly/privly-applications/comments{/number}","issue_comment_url":"https://api.github.com/repos/privly/privly-applications/issues/comments{/number}","contents_url":"https://api.github.com/repos/privly/privly-applications/contents/{+path}","compare_url":"https://api.github.com/repos/privly/privly-applications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privly/privly-applications/merges","archive_url":"https://api.github.com/repos/privly/privly-applications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privly/privly-applications/downloads","issues_url":"https://api.github.com/repos/privly/privly-applications/issues{/number}","pulls_url":"https://api.github.com/repos/privly/privly-applications/pulls{/number}","milestones_url":"https://api.github.com/repos/privly/privly-applications/milestones{/number}","notifications_url":"https://api.github.com/repos/privly/privly-applications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privly/privly-applications/labels{/name}","releases_url":"https://api.github.com/repos/privly/privly-applications/releases{/id}","created_at":"2013-04-20T01:37:17Z","updated_at":"2015-06-14T18:44:21Z","pushed_at":"2015-07-15T20:28:01Z","git_url":"git://github.com/privly/privly-applications.git","ssh_url":"git@github.com:privly/privly-applications.git","clone_url":"https://github.com/privly/privly-applications.git","svn_url":"https://github.com/privly/privly-applications","homepage":null,"size":9803,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":29,"forks":46,"open_issues":29,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/privly/privly-applications/pulls/271"},"html":{"href":"https://github.com/privly/privly-applications/pull/271"},"issue":{"href":"https://api.github.com/repos/privly/privly-applications/issues/271"},"comments":{"href":"https://api.github.com/repos/privly/privly-applications/issues/271/comments"},"review_comments":{"href":"https://api.github.com/repos/privly/privly-applications/pulls/271/comments"},"review_comment":{"href":"https://api.github.com/repos/privly/privly-applications/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/privly/privly-applications/pulls/271/commits"},"statuses":{"href":"https://api.github.com/repos/privly/privly-applications/statuses/7fe296a229bbcbf89f44de92211af4a442eef5d7"}}}}