{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/frontend/pulls/comments/92920747","pull_request_review_id":13444360,"id":92920747,"diff_hunk":"@@ -32,18 +34,20 @@ define([\n     }\n \n     function noAdblockMsg() {\n-        return adblockInUseSync() && notMobile() && (\n+        return adblockInUse().then(function(adblockInUse){","path":"static/src/javascripts/projects/common/modules/commercial/adblock-messages.js","position":27,"original_position":27,"commit_id":"c6356e9af3334c6ae150f2dcbcacf1a28a3dba30","original_commit_id":"c6356e9af3334c6ae150f2dcbcacf1a28a3dba30","user":{"login":"regiskuckaertz","id":629976,"avatar_url":"https://avatars.githubusercontent.com/u/629976?v=3","gravatar_id":"","url":"https://api.github.com/users/regiskuckaertz","html_url":"https://github.com/regiskuckaertz","followers_url":"https://api.github.com/users/regiskuckaertz/followers","following_url":"https://api.github.com/users/regiskuckaertz/following{/other_user}","gists_url":"https://api.github.com/users/regiskuckaertz/gists{/gist_id}","starred_url":"https://api.github.com/users/regiskuckaertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regiskuckaertz/subscriptions","organizations_url":"https://api.github.com/users/regiskuckaertz/orgs","repos_url":"https://api.github.com/users/regiskuckaertz/repos","events_url":"https://api.github.com/users/regiskuckaertz/events{/privacy}","received_events_url":"https://api.github.com/users/regiskuckaertz/received_events","type":"User","site_admin":false},"body":"We could improve this expression and the next, by delaying the adblock test as much as possible:\r\n\r\n```\r\nreturn notMobile() && (!visitedMoreThanOnce() || !isAdblockSwitchOn() || (visitedMoreThanOnce() && isPayingMember())) ?\r\n  adblockInUse() :\r\n  Promise.resolve(false);\r\n```\r\n\r\n(notice I removed the redundant `isAdblockSwitchOn` call in the third OR clause)\r\n\r\nI'll leave you the one in `showAdblockMsg` as a small exercise.","created_at":"2016-12-17T12:07:44Z","updated_at":"2016-12-17T12:18:00Z","html_url":"https://github.com/guardian/frontend/pull/15373#discussion_r92920747","pull_request_url":"https://api.github.com/repos/guardian/frontend/pulls/15373","_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments/92920747"},"html":{"href":"https://github.com/guardian/frontend/pull/15373#discussion_r92920747"},"pull_request":{"href":"https://api.github.com/repos/guardian/frontend/pulls/15373"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/frontend/pulls/15373","id":98370224,"html_url":"https://github.com/guardian/frontend/pull/15373","diff_url":"https://github.com/guardian/frontend/pull/15373.diff","patch_url":"https://github.com/guardian/frontend/pull/15373.patch","issue_url":"https://api.github.com/repos/guardian/frontend/issues/15373","number":15373,"state":"open","locked":false,"title":"Include firefox adblock detection","user":{"login":"Calum-Campbell","id":14179210,"avatar_url":"https://avatars.githubusercontent.com/u/14179210?v=3","gravatar_id":"","url":"https://api.github.com/users/Calum-Campbell","html_url":"https://github.com/Calum-Campbell","followers_url":"https://api.github.com/users/Calum-Campbell/followers","following_url":"https://api.github.com/users/Calum-Campbell/following{/other_user}","gists_url":"https://api.github.com/users/Calum-Campbell/gists{/gist_id}","starred_url":"https://api.github.com/users/Calum-Campbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Calum-Campbell/subscriptions","organizations_url":"https://api.github.com/users/Calum-Campbell/orgs","repos_url":"https://api.github.com/users/Calum-Campbell/repos","events_url":"https://api.github.com/users/Calum-Campbell/events{/privacy}","received_events_url":"https://api.github.com/users/Calum-Campbell/received_events","type":"User","site_admin":false},"body":"## What does this change?\r\n Two things : \r\n- The adblock_detected flag was broken on firefox due to a adblockPlus update, this updates the logic to identify when adblockerPlus is being used on FF.\r\n- The old adblock detection was mostly using synchronous calls, this promisifys the adblock detection and makes it asychronous and updates the various parts of frontend that used the adblock detection to this new functionality. \r\n\r\n@guardian/commercial-dev @sndrs \r\n\r\n\r\n","created_at":"2016-12-16T17:09:50Z","updated_at":"2016-12-17T12:18:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"076059d42840531e68a42a46b6797403976c79dd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/frontend/pulls/15373/commits","review_comments_url":"https://api.github.com/repos/guardian/frontend/pulls/15373/comments","review_comment_url":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/frontend/issues/15373/comments","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/c6356e9af3334c6ae150f2dcbcacf1a28a3dba30","head":{"label":"guardian:include-firefox-adblock-detection","ref":"include-firefox-adblock-detection","sha":"c6356e9af3334c6ae150f2dcbcacf1a28a3dba30","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":4370755,"name":"frontend","full_name":"guardian/frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/frontend/deployments","created_at":"2012-05-18T15:39:15Z","updated_at":"2016-12-15T20:43:05Z","pushed_at":"2016-12-17T10:51:14Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"http://www.theguardian.com","size":493975,"stargazers_count":3445,"watchers_count":3445,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":366,"mirror_url":null,"open_issues_count":55,"forks":366,"open_issues":55,"watchers":3445,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"5b170a1be90f00eb8414b9095b5c9100db64b6e4","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":4370755,"name":"frontend","full_name":"guardian/frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/frontend/deployments","created_at":"2012-05-18T15:39:15Z","updated_at":"2016-12-15T20:43:05Z","pushed_at":"2016-12-17T10:51:14Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"http://www.theguardian.com","size":493975,"stargazers_count":3445,"watchers_count":3445,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":366,"mirror_url":null,"open_issues_count":55,"forks":366,"open_issues":55,"watchers":3445,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/15373"},"html":{"href":"https://github.com/guardian/frontend/pull/15373"},"issue":{"href":"https://api.github.com/repos/guardian/frontend/issues/15373"},"comments":{"href":"https://api.github.com/repos/guardian/frontend/issues/15373/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/frontend/pulls/15373/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/frontend/pulls/15373/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/frontend/statuses/c6356e9af3334c6ae150f2dcbcacf1a28a3dba30"}}}}
{"actor":{"display_login":"regiskuckaertz"}}