{"action":"opened","issue":{"url":"https://api.github.com/repos/segmentio/nightmare/issues/1435","repository_url":"https://api.github.com/repos/segmentio/nightmare","labels_url":"https://api.github.com/repos/segmentio/nightmare/issues/1435/labels{/name}","comments_url":"https://api.github.com/repos/segmentio/nightmare/issues/1435/comments","events_url":"https://api.github.com/repos/segmentio/nightmare/issues/1435/events","html_url":"https://github.com/segmentio/nightmare/issues/1435","id":315499453,"number":1435,"title":"Way to stop loading on dom-ready","user":{"login":"entrptaher","id":8284972,"avatar_url":"https://avatars2.githubusercontent.com/u/8284972?v=4","gravatar_id":"","url":"https://api.github.com/users/entrptaher","html_url":"https://github.com/entrptaher","followers_url":"https://api.github.com/users/entrptaher/followers","following_url":"https://api.github.com/users/entrptaher/following{/other_user}","gists_url":"https://api.github.com/users/entrptaher/gists{/gist_id}","starred_url":"https://api.github.com/users/entrptaher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/entrptaher/subscriptions","organizations_url":"https://api.github.com/users/entrptaher/orgs","repos_url":"https://api.github.com/users/entrptaher/repos","events_url":"https://api.github.com/users/entrptaher/events{/privacy}","received_events_url":"https://api.github.com/users/entrptaher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-18T14:16:32Z","updated_at":"2018-04-18T14:16:32Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"If we want to stop the page loading on certain event like `dom-ready`, there is currently no way to do so. This have been requested in different issues but was never implemented. \r\n\r\nIssue like #904 #959 , Stackoverflow questions like [this](https://stackoverflow.com/questions/49742363/start-scraping-as-soon-as-dom-is-ready-nightmarejs) all point to same direction that we need to have better access to the events and actions.\r\n\r\nFor this purpose, electron has great functions ready for us to use such as `contents.isLoading()` and `contents.stop()`.\r\n\r\nOther libraries such as puppeteer has `waitUntil` method which waits until there is only 2 resources pending loading etc. On nightmare we don't have any extra options like that. What we have is a simple `self.child.call('goto')` which can be improved further.\r\n\r\nThis issue can also be seen as, Better way to access **events**, **win.contents** and **win.webContents**. "}}
{"actor":{"display_login":"entrptaher"}}