{"action":"created","comment":{"url":"https://api.github.com/repos/amir20/phantomjs-node/pulls/comments/71741939","id":71741939,"diff_hunk":"@@ -91,23 +91,39 @@ const commands = {\n         completeCommand(command);\n     },\n \n+    loadPageContent: function (command) {\n+        let page = objectSpace[command.target];\n+        if(!page) {\n+            command.response = false;\n+            return completeCommand(command);\n+        }\n+\n+        page.onLoadFinished = result => {","path":"src/shim.js","position":11,"original_position":11,"commit_id":"d4c5bdb4fb4b385c3dcfd98a5f70a843a6d33fdf","original_commit_id":"d4c5bdb4fb4b385c3dcfd98a5f70a843a6d33fdf","user":{"login":"elias-winberg","id":10573148,"avatar_url":"https://avatars.githubusercontent.com/u/10573148?v=3","gravatar_id":"","url":"https://api.github.com/users/elias-winberg","html_url":"https://github.com/elias-winberg","followers_url":"https://api.github.com/users/elias-winberg/followers","following_url":"https://api.github.com/users/elias-winberg/following{/other_user}","gists_url":"https://api.github.com/users/elias-winberg/gists{/gist_id}","starred_url":"https://api.github.com/users/elias-winberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elias-winberg/subscriptions","organizations_url":"https://api.github.com/users/elias-winberg/orgs","repos_url":"https://api.github.com/users/elias-winberg/repos","events_url":"https://api.github.com/users/elias-winberg/events{/privacy}","received_events_url":"https://api.github.com/users/elias-winberg/received_events","type":"User","site_admin":false},"body":"Doesn't this override the event handler for `onLoadFinished`?","created_at":"2016-07-21T16:44:23Z","updated_at":"2016-07-21T16:44:23Z","html_url":"https://github.com/amir20/phantomjs-node/pull/508#discussion_r71741939","pull_request_url":"https://api.github.com/repos/amir20/phantomjs-node/pulls/508","_links":{"self":{"href":"https://api.github.com/repos/amir20/phantomjs-node/pulls/comments/71741939"},"html":{"href":"https://github.com/amir20/phantomjs-node/pull/508#discussion_r71741939"},"pull_request":{"href":"https://api.github.com/repos/amir20/phantomjs-node/pulls/508"}}},"pull_request":{"url":"https://api.github.com/repos/amir20/phantomjs-node/pulls/508","id":78288178,"html_url":"https://github.com/amir20/phantomjs-node/pull/508","diff_url":"https://github.com/amir20/phantomjs-node/pull/508.diff","patch_url":"https://github.com/amir20/phantomjs-node/pull/508.patch","issue_url":"https://api.github.com/repos/amir20/phantomjs-node/issues/508","number":508,"state":"open","locked":false,"title":"Added a reliable way of loading page contents","user":{"login":"akkenoth","id":4386503,"avatar_url":"https://avatars.githubusercontent.com/u/4386503?v=3","gravatar_id":"","url":"https://api.github.com/users/akkenoth","html_url":"https://github.com/akkenoth","followers_url":"https://api.github.com/users/akkenoth/followers","following_url":"https://api.github.com/users/akkenoth/following{/other_user}","gists_url":"https://api.github.com/users/akkenoth/gists{/gist_id}","starred_url":"https://api.github.com/users/akkenoth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akkenoth/subscriptions","organizations_url":"https://api.github.com/users/akkenoth/orgs","repos_url":"https://api.github.com/users/akkenoth/repos","events_url":"https://api.github.com/users/akkenoth/events{/privacy}","received_events_url":"https://api.github.com/users/akkenoth/received_events","type":"User","site_admin":false},"body":"### Proposed changes in this pull request\r\n\r\nCreated page#loadContent(), which works more or less like setContent() in pre-2.x releases.\r\nEssentially it calls setContent() but resolves on onPageLoaded instead of immediately, thus providing kind of workaround for [PhantomJS issue with crashing on rendering not-fully-loaded pages](https://github.com/ariya/phantomjs/issues/12750).\r\n\r\nAdded docs with additional notes on difference between loadContent and setContent.\r\nAdded test unit, which while not being the cleanest one still tests the expected functionality.\r\n\r\nTest build is available [here](https://github.com/greatcare/phantomjs-node/releases/tag/v2.1.13-rc2).\r\nAs in our previous pull request, the build has been tested and proven to work in a real environment (in which we had problems with setContent()).\r\n\r\n#### Checklist\r\n* [x] New tests have been added\r\n* [x] `npm test` passes successfully\r\n* [x] Documentation has been updated\r\n\r\n@amir20 to review\r\n","created_at":"2016-07-21T09:55:51Z","updated_at":"2016-07-21T16:44:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a7ace9e183dddf1ce708f340d306a02af01b363","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/amir20/phantomjs-node/pulls/508/commits","review_comments_url":"https://api.github.com/repos/amir20/phantomjs-node/pulls/508/comments","review_comment_url":"https://api.github.com/repos/amir20/phantomjs-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amir20/phantomjs-node/issues/508/comments","statuses_url":"https://api.github.com/repos/amir20/phantomjs-node/statuses/d4c5bdb4fb4b385c3dcfd98a5f70a843a6d33fdf","head":{"label":"greatcare:master","ref":"master","sha":"d4c5bdb4fb4b385c3dcfd98a5f70a843a6d33fdf","user":{"login":"greatcare","id":17923652,"avatar_url":"https://avatars.githubusercontent.com/u/17923652?v=3","gravatar_id":"","url":"https://api.github.com/users/greatcare","html_url":"https://github.com/greatcare","followers_url":"https://api.github.com/users/greatcare/followers","following_url":"https://api.github.com/users/greatcare/following{/other_user}","gists_url":"https://api.github.com/users/greatcare/gists{/gist_id}","starred_url":"https://api.github.com/users/greatcare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greatcare/subscriptions","organizations_url":"https://api.github.com/users/greatcare/orgs","repos_url":"https://api.github.com/users/greatcare/repos","events_url":"https://api.github.com/users/greatcare/events{/privacy}","received_events_url":"https://api.github.com/users/greatcare/received_events","type":"Organization","site_admin":false},"repo":{"id":63674199,"name":"phantomjs-node","full_name":"greatcare/phantomjs-node","owner":{"login":"greatcare","id":17923652,"avatar_url":"https://avatars.githubusercontent.com/u/17923652?v=3","gravatar_id":"","url":"https://api.github.com/users/greatcare","html_url":"https://github.com/greatcare","followers_url":"https://api.github.com/users/greatcare/followers","following_url":"https://api.github.com/users/greatcare/following{/other_user}","gists_url":"https://api.github.com/users/greatcare/gists{/gist_id}","starred_url":"https://api.github.com/users/greatcare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greatcare/subscriptions","organizations_url":"https://api.github.com/users/greatcare/orgs","repos_url":"https://api.github.com/users/greatcare/repos","events_url":"https://api.github.com/users/greatcare/events{/privacy}","received_events_url":"https://api.github.com/users/greatcare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/greatcare/phantomjs-node","description":"PhantomJS integration module for NodeJS","fork":true,"url":"https://api.github.com/repos/greatcare/phantomjs-node","forks_url":"https://api.github.com/repos/greatcare/phantomjs-node/forks","keys_url":"https://api.github.com/repos/greatcare/phantomjs-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greatcare/phantomjs-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greatcare/phantomjs-node/teams","hooks_url":"https://api.github.com/repos/greatcare/phantomjs-node/hooks","issue_events_url":"https://api.github.com/repos/greatcare/phantomjs-node/issues/events{/number}","events_url":"https://api.github.com/repos/greatcare/phantomjs-node/events","assignees_url":"https://api.github.com/repos/greatcare/phantomjs-node/assignees{/user}","branches_url":"https://api.github.com/repos/greatcare/phantomjs-node/branches{/branch}","tags_url":"https://api.github.com/repos/greatcare/phantomjs-node/tags","blobs_url":"https://api.github.com/repos/greatcare/phantomjs-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greatcare/phantomjs-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greatcare/phantomjs-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/greatcare/phantomjs-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greatcare/phantomjs-node/statuses/{sha}","languages_url":"https://api.github.com/repos/greatcare/phantomjs-node/languages","stargazers_url":"https://api.github.com/repos/greatcare/phantomjs-node/stargazers","contributors_url":"https://api.github.com/repos/greatcare/phantomjs-node/contributors","subscribers_url":"https://api.github.com/repos/greatcare/phantomjs-node/subscribers","subscription_url":"https://api.github.com/repos/greatcare/phantomjs-node/subscription","commits_url":"https://api.github.com/repos/greatcare/phantomjs-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/greatcare/phantomjs-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/greatcare/phantomjs-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/greatcare/phantomjs-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/greatcare/phantomjs-node/contents/{+path}","compare_url":"https://api.github.com/repos/greatcare/phantomjs-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greatcare/phantomjs-node/merges","archive_url":"https://api.github.com/repos/greatcare/phantomjs-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greatcare/phantomjs-node/downloads","issues_url":"https://api.github.com/repos/greatcare/phantomjs-node/issues{/number}","pulls_url":"https://api.github.com/repos/greatcare/phantomjs-node/pulls{/number}","milestones_url":"https://api.github.com/repos/greatcare/phantomjs-node/milestones{/number}","notifications_url":"https://api.github.com/repos/greatcare/phantomjs-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greatcare/phantomjs-node/labels{/name}","releases_url":"https://api.github.com/repos/greatcare/phantomjs-node/releases{/id}","deployments_url":"https://api.github.com/repos/greatcare/phantomjs-node/deployments","created_at":"2016-07-19T08:06:38Z","updated_at":"2016-07-19T08:06:40Z","pushed_at":"2016-07-21T09:44:27Z","git_url":"git://github.com/greatcare/phantomjs-node.git","ssh_url":"git@github.com:greatcare/phantomjs-node.git","clone_url":"https://github.com/greatcare/phantomjs-node.git","svn_url":"https://github.com/greatcare/phantomjs-node","homepage":"","size":3618,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"amir20:master","ref":"master","sha":"fcf242dc9fab1699ce878d711c1c4f17aa8b0f0b","user":{"login":"amir20","id":260667,"avatar_url":"https://avatars.githubusercontent.com/u/260667?v=3","gravatar_id":"","url":"https://api.github.com/users/amir20","html_url":"https://github.com/amir20","followers_url":"https://api.github.com/users/amir20/followers","following_url":"https://api.github.com/users/amir20/following{/other_user}","gists_url":"https://api.github.com/users/amir20/gists{/gist_id}","starred_url":"https://api.github.com/users/amir20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amir20/subscriptions","organizations_url":"https://api.github.com/users/amir20/orgs","repos_url":"https://api.github.com/users/amir20/repos","events_url":"https://api.github.com/users/amir20/events{/privacy}","received_events_url":"https://api.github.com/users/amir20/received_events","type":"User","site_admin":false},"repo":{"id":2493754,"name":"phantomjs-node","full_name":"amir20/phantomjs-node","owner":{"login":"amir20","id":260667,"avatar_url":"https://avatars.githubusercontent.com/u/260667?v=3","gravatar_id":"","url":"https://api.github.com/users/amir20","html_url":"https://github.com/amir20","followers_url":"https://api.github.com/users/amir20/followers","following_url":"https://api.github.com/users/amir20/following{/other_user}","gists_url":"https://api.github.com/users/amir20/gists{/gist_id}","starred_url":"https://api.github.com/users/amir20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amir20/subscriptions","organizations_url":"https://api.github.com/users/amir20/orgs","repos_url":"https://api.github.com/users/amir20/repos","events_url":"https://api.github.com/users/amir20/events{/privacy}","received_events_url":"https://api.github.com/users/amir20/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amir20/phantomjs-node","description":"PhantomJS integration module for NodeJS","fork":false,"url":"https://api.github.com/repos/amir20/phantomjs-node","forks_url":"https://api.github.com/repos/amir20/phantomjs-node/forks","keys_url":"https://api.github.com/repos/amir20/phantomjs-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amir20/phantomjs-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amir20/phantomjs-node/teams","hooks_url":"https://api.github.com/repos/amir20/phantomjs-node/hooks","issue_events_url":"https://api.github.com/repos/amir20/phantomjs-node/issues/events{/number}","events_url":"https://api.github.com/repos/amir20/phantomjs-node/events","assignees_url":"https://api.github.com/repos/amir20/phantomjs-node/assignees{/user}","branches_url":"https://api.github.com/repos/amir20/phantomjs-node/branches{/branch}","tags_url":"https://api.github.com/repos/amir20/phantomjs-node/tags","blobs_url":"https://api.github.com/repos/amir20/phantomjs-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amir20/phantomjs-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amir20/phantomjs-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/amir20/phantomjs-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amir20/phantomjs-node/statuses/{sha}","languages_url":"https://api.github.com/repos/amir20/phantomjs-node/languages","stargazers_url":"https://api.github.com/repos/amir20/phantomjs-node/stargazers","contributors_url":"https://api.github.com/repos/amir20/phantomjs-node/contributors","subscribers_url":"https://api.github.com/repos/amir20/phantomjs-node/subscribers","subscription_url":"https://api.github.com/repos/amir20/phantomjs-node/subscription","commits_url":"https://api.github.com/repos/amir20/phantomjs-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/amir20/phantomjs-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/amir20/phantomjs-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/amir20/phantomjs-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/amir20/phantomjs-node/contents/{+path}","compare_url":"https://api.github.com/repos/amir20/phantomjs-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amir20/phantomjs-node/merges","archive_url":"https://api.github.com/repos/amir20/phantomjs-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amir20/phantomjs-node/downloads","issues_url":"https://api.github.com/repos/amir20/phantomjs-node/issues{/number}","pulls_url":"https://api.github.com/repos/amir20/phantomjs-node/pulls{/number}","milestones_url":"https://api.github.com/repos/amir20/phantomjs-node/milestones{/number}","notifications_url":"https://api.github.com/repos/amir20/phantomjs-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amir20/phantomjs-node/labels{/name}","releases_url":"https://api.github.com/repos/amir20/phantomjs-node/releases{/id}","deployments_url":"https://api.github.com/repos/amir20/phantomjs-node/deployments","created_at":"2011-10-01T06:01:36Z","updated_at":"2016-07-21T12:42:23Z","pushed_at":"2016-07-21T16:26:10Z","git_url":"git://github.com/amir20/phantomjs-node.git","ssh_url":"git@github.com:amir20/phantomjs-node.git","clone_url":"https://github.com/amir20/phantomjs-node.git","svn_url":"https://github.com/amir20/phantomjs-node","homepage":"","size":9655,"stargazers_count":2079,"watchers_count":2079,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":353,"mirror_url":null,"open_issues_count":4,"forks":353,"open_issues":4,"watchers":2079,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amir20/phantomjs-node/pulls/508"},"html":{"href":"https://github.com/amir20/phantomjs-node/pull/508"},"issue":{"href":"https://api.github.com/repos/amir20/phantomjs-node/issues/508"},"comments":{"href":"https://api.github.com/repos/amir20/phantomjs-node/issues/508/comments"},"review_comments":{"href":"https://api.github.com/repos/amir20/phantomjs-node/pulls/508/comments"},"review_comment":{"href":"https://api.github.com/repos/amir20/phantomjs-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amir20/phantomjs-node/pulls/508/commits"},"statuses":{"href":"https://api.github.com/repos/amir20/phantomjs-node/statuses/d4c5bdb4fb4b385c3dcfd98a5f70a843a6d33fdf"}}}}
{"actor":{"display_login":"elias-winberg"}}