{"action":"created","comment":{"url":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/comments/35629535","id":35629535,"diff_hunk":"@@ -68,6 +68,25 @@ chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {\n         args.cookies = document.cookie;\n     }\n \n+    if (msg.tradesNotification) {\n+        var tradesBtn = $('#menu>a').eq(1);","path":"app/inject.js","position":5,"original_position":5,"commit_id":"f4276034cd4b5807c66e52b44016aae349dc3c9c","original_commit_id":"f4276034cd4b5807c66e52b44016aae349dc3c9c","user":{"login":"ncla","id":5507083,"avatar_url":"https://avatars.githubusercontent.com/u/5507083?v=3","gravatar_id":"","url":"https://api.github.com/users/ncla","html_url":"https://github.com/ncla","followers_url":"https://api.github.com/users/ncla/followers","following_url":"https://api.github.com/users/ncla/following{/other_user}","gists_url":"https://api.github.com/users/ncla/gists{/gist_id}","starred_url":"https://api.github.com/users/ncla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncla/subscriptions","organizations_url":"https://api.github.com/users/ncla/orgs","repos_url":"https://api.github.com/users/ncla/repos","events_url":"https://api.github.com/users/ncla/events{/privacy}","received_events_url":"https://api.github.com/users/ncla/received_events","type":"User","site_admin":false},"body":"A better and much safer way would be selecting link by the URL, otherwise if some other extension added a menu link or the site itself adds another link then it will break. In background.js we have this:\r\n```\r\n    var trades = data.find('a[href$=\"mytrades\"]:first');\r\n    var offers = data.find('a[href$=\"myoffers\"]:first');\r\n```","created_at":"2015-07-28T09:30:11Z","updated_at":"2015-07-28T09:30:11Z","html_url":"https://github.com/ncla/LoungeDestroyer/pull/243#discussion_r35629535","pull_request_url":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/243","_links":{"self":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/comments/35629535"},"html":{"href":"https://github.com/ncla/LoungeDestroyer/pull/243#discussion_r35629535"},"pull_request":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/243"}}},"pull_request":{"url":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/243","id":40977828,"html_url":"https://github.com/ncla/LoungeDestroyer/pull/243","diff_url":"https://github.com/ncla/LoungeDestroyer/pull/243.diff","patch_url":"https://github.com/ncla/LoungeDestroyer/pull/243.patch","issue_url":"https://api.github.com/repos/ncla/LoungeDestroyer/issues/243","number":243,"state":"open","locked":false,"title":"Offers / trades notifications","user":{"login":"Andrej730","id":9417531,"avatar_url":"https://avatars.githubusercontent.com/u/9417531?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrej730","html_url":"https://github.com/Andrej730","followers_url":"https://api.github.com/users/Andrej730/followers","following_url":"https://api.github.com/users/Andrej730/following{/other_user}","gists_url":"https://api.github.com/users/Andrej730/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrej730/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrej730/subscriptions","organizations_url":"https://api.github.com/users/Andrej730/orgs","repos_url":"https://api.github.com/users/Andrej730/repos","events_url":"https://api.github.com/users/Andrej730/events{/privacy}","received_events_url":"https://api.github.com/users/Andrej730/received_events","type":"User","site_admin":false},"body":"Now notifications about new offers / trades are displayed in already opened\r\ntabs.","created_at":"2015-07-28T06:01:20Z","updated_at":"2015-07-28T09:30:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97b0e08e2d179fb67e488af1cca33b67b2cf7921","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/243/commits","review_comments_url":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/243/comments","review_comment_url":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ncla/LoungeDestroyer/issues/243/comments","statuses_url":"https://api.github.com/repos/ncla/LoungeDestroyer/statuses/f4276034cd4b5807c66e52b44016aae349dc3c9c","head":{"label":"Andrej730:master","ref":"master","sha":"f4276034cd4b5807c66e52b44016aae349dc3c9c","user":{"login":"Andrej730","id":9417531,"avatar_url":"https://avatars.githubusercontent.com/u/9417531?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrej730","html_url":"https://github.com/Andrej730","followers_url":"https://api.github.com/users/Andrej730/followers","following_url":"https://api.github.com/users/Andrej730/following{/other_user}","gists_url":"https://api.github.com/users/Andrej730/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrej730/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrej730/subscriptions","organizations_url":"https://api.github.com/users/Andrej730/orgs","repos_url":"https://api.github.com/users/Andrej730/repos","events_url":"https://api.github.com/users/Andrej730/events{/privacy}","received_events_url":"https://api.github.com/users/Andrej730/received_events","type":"User","site_admin":false},"repo":{"id":39701611,"name":"LoungeDestroyer","full_name":"Andrej730/LoungeDestroyer","owner":{"login":"Andrej730","id":9417531,"avatar_url":"https://avatars.githubusercontent.com/u/9417531?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrej730","html_url":"https://github.com/Andrej730","followers_url":"https://api.github.com/users/Andrej730/followers","following_url":"https://api.github.com/users/Andrej730/following{/other_user}","gists_url":"https://api.github.com/users/Andrej730/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrej730/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrej730/subscriptions","organizations_url":"https://api.github.com/users/Andrej730/orgs","repos_url":"https://api.github.com/users/Andrej730/repos","events_url":"https://api.github.com/users/Andrej730/events{/privacy}","received_events_url":"https://api.github.com/users/Andrej730/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Andrej730/LoungeDestroyer","description":"Chrome extension for CS:GO Lounge and DOTA2 Lounge","fork":true,"url":"https://api.github.com/repos/Andrej730/LoungeDestroyer","forks_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/forks","keys_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/teams","hooks_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/hooks","issue_events_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/issues/events{/number}","events_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/events","assignees_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/assignees{/user}","branches_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/branches{/branch}","tags_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/tags","blobs_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/statuses/{sha}","languages_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/languages","stargazers_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/stargazers","contributors_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/contributors","subscribers_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/subscribers","subscription_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/subscription","commits_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/contents/{+path}","compare_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/merges","archive_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/downloads","issues_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/issues{/number}","pulls_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/pulls{/number}","milestones_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/milestones{/number}","notifications_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/labels{/name}","releases_url":"https://api.github.com/repos/Andrej730/LoungeDestroyer/releases{/id}","created_at":"2015-07-25T20:19:42Z","updated_at":"2015-07-25T20:19:43Z","pushed_at":"2015-07-28T06:00:31Z","git_url":"git://github.com/Andrej730/LoungeDestroyer.git","ssh_url":"git@github.com:Andrej730/LoungeDestroyer.git","clone_url":"https://github.com/Andrej730/LoungeDestroyer.git","svn_url":"https://github.com/Andrej730/LoungeDestroyer","homepage":"","size":5805,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ncla:master","ref":"master","sha":"b7ce08fd7bdf08df99a1fac950460221de1f2f3f","user":{"login":"ncla","id":5507083,"avatar_url":"https://avatars.githubusercontent.com/u/5507083?v=3","gravatar_id":"","url":"https://api.github.com/users/ncla","html_url":"https://github.com/ncla","followers_url":"https://api.github.com/users/ncla/followers","following_url":"https://api.github.com/users/ncla/following{/other_user}","gists_url":"https://api.github.com/users/ncla/gists{/gist_id}","starred_url":"https://api.github.com/users/ncla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncla/subscriptions","organizations_url":"https://api.github.com/users/ncla/orgs","repos_url":"https://api.github.com/users/ncla/repos","events_url":"https://api.github.com/users/ncla/events{/privacy}","received_events_url":"https://api.github.com/users/ncla/received_events","type":"User","site_admin":false},"repo":{"id":20337382,"name":"LoungeDestroyer","full_name":"ncla/LoungeDestroyer","owner":{"login":"ncla","id":5507083,"avatar_url":"https://avatars.githubusercontent.com/u/5507083?v=3","gravatar_id":"","url":"https://api.github.com/users/ncla","html_url":"https://github.com/ncla","followers_url":"https://api.github.com/users/ncla/followers","following_url":"https://api.github.com/users/ncla/following{/other_user}","gists_url":"https://api.github.com/users/ncla/gists{/gist_id}","starred_url":"https://api.github.com/users/ncla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncla/subscriptions","organizations_url":"https://api.github.com/users/ncla/orgs","repos_url":"https://api.github.com/users/ncla/repos","events_url":"https://api.github.com/users/ncla/events{/privacy}","received_events_url":"https://api.github.com/users/ncla/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ncla/LoungeDestroyer","description":"Chrome extension for CS:GO Lounge and DOTA2 Lounge","fork":false,"url":"https://api.github.com/repos/ncla/LoungeDestroyer","forks_url":"https://api.github.com/repos/ncla/LoungeDestroyer/forks","keys_url":"https://api.github.com/repos/ncla/LoungeDestroyer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ncla/LoungeDestroyer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ncla/LoungeDestroyer/teams","hooks_url":"https://api.github.com/repos/ncla/LoungeDestroyer/hooks","issue_events_url":"https://api.github.com/repos/ncla/LoungeDestroyer/issues/events{/number}","events_url":"https://api.github.com/repos/ncla/LoungeDestroyer/events","assignees_url":"https://api.github.com/repos/ncla/LoungeDestroyer/assignees{/user}","branches_url":"https://api.github.com/repos/ncla/LoungeDestroyer/branches{/branch}","tags_url":"https://api.github.com/repos/ncla/LoungeDestroyer/tags","blobs_url":"https://api.github.com/repos/ncla/LoungeDestroyer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ncla/LoungeDestroyer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ncla/LoungeDestroyer/git/refs{/sha}","trees_url":"https://api.github.com/repos/ncla/LoungeDestroyer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ncla/LoungeDestroyer/statuses/{sha}","languages_url":"https://api.github.com/repos/ncla/LoungeDestroyer/languages","stargazers_url":"https://api.github.com/repos/ncla/LoungeDestroyer/stargazers","contributors_url":"https://api.github.com/repos/ncla/LoungeDestroyer/contributors","subscribers_url":"https://api.github.com/repos/ncla/LoungeDestroyer/subscribers","subscription_url":"https://api.github.com/repos/ncla/LoungeDestroyer/subscription","commits_url":"https://api.github.com/repos/ncla/LoungeDestroyer/commits{/sha}","git_commits_url":"https://api.github.com/repos/ncla/LoungeDestroyer/git/commits{/sha}","comments_url":"https://api.github.com/repos/ncla/LoungeDestroyer/comments{/number}","issue_comment_url":"https://api.github.com/repos/ncla/LoungeDestroyer/issues/comments{/number}","contents_url":"https://api.github.com/repos/ncla/LoungeDestroyer/contents/{+path}","compare_url":"https://api.github.com/repos/ncla/LoungeDestroyer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ncla/LoungeDestroyer/merges","archive_url":"https://api.github.com/repos/ncla/LoungeDestroyer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ncla/LoungeDestroyer/downloads","issues_url":"https://api.github.com/repos/ncla/LoungeDestroyer/issues{/number}","pulls_url":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls{/number}","milestones_url":"https://api.github.com/repos/ncla/LoungeDestroyer/milestones{/number}","notifications_url":"https://api.github.com/repos/ncla/LoungeDestroyer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ncla/LoungeDestroyer/labels{/name}","releases_url":"https://api.github.com/repos/ncla/LoungeDestroyer/releases{/id}","created_at":"2014-05-30T17:50:32Z","updated_at":"2015-07-22T21:04:27Z","pushed_at":"2015-07-28T06:01:20Z","git_url":"git://github.com/ncla/LoungeDestroyer.git","ssh_url":"git@github.com:ncla/LoungeDestroyer.git","clone_url":"https://github.com/ncla/LoungeDestroyer.git","svn_url":"https://github.com/ncla/LoungeDestroyer","homepage":"","size":5805,"stargazers_count":44,"watchers_count":44,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":62,"mirror_url":null,"open_issues_count":17,"forks":62,"open_issues":17,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/243"},"html":{"href":"https://github.com/ncla/LoungeDestroyer/pull/243"},"issue":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/issues/243"},"comments":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/issues/243/comments"},"review_comments":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/243/comments"},"review_comment":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/pulls/243/commits"},"statuses":{"href":"https://api.github.com/repos/ncla/LoungeDestroyer/statuses/f4276034cd4b5807c66e52b44016aae349dc3c9c"}}}}