{"action":"created","issue":{"url":"https://api.github.com/repos/ariya/phantomjs/issues/13832","labels_url":"https://api.github.com/repos/ariya/phantomjs/issues/13832/labels{/name}","comments_url":"https://api.github.com/repos/ariya/phantomjs/issues/13832/comments","events_url":"https://api.github.com/repos/ariya/phantomjs/issues/13832/events","html_url":"https://github.com/ariya/phantomjs/issues/13832","id":123938510,"number":13832,"title":"webpage.open callback never called in PhantomJS 2.0 ","user":{"login":"evger","id":16445863,"avatar_url":"https://avatars.githubusercontent.com/u/16445863?v=3","gravatar_id":"","url":"https://api.github.com/users/evger","html_url":"https://github.com/evger","followers_url":"https://api.github.com/users/evger/followers","following_url":"https://api.github.com/users/evger/following{/other_user}","gists_url":"https://api.github.com/users/evger/gists{/gist_id}","starred_url":"https://api.github.com/users/evger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evger/subscriptions","organizations_url":"https://api.github.com/users/evger/orgs","repos_url":"https://api.github.com/users/evger/repos","events_url":"https://api.github.com/users/evger/events{/privacy}","received_events_url":"https://api.github.com/users/evger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ariya/phantomjs/labels/2.0","name":"2.0","color":"52a6e0"},{"url":"https://api.github.com/repos/ariya/phantomjs/labels/2.0%20Regression","name":"2.0 Regression","color":"EE3F46"},{"url":"https://api.github.com/repos/ariya/phantomjs/labels/Bug","name":"Bug","color":"f45d43"},{"url":"https://api.github.com/repos/ariya/phantomjs/labels/Need%20more%20information","name":"Need more information","color":"CC317C"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-26T16:43:25Z","updated_at":"2015-12-26T16:59:58Z","closed_at":null,"body":"Test script\r\n\r\n    \"use strict\";\r\n    var server = require('webserver').create();\r\n    var webpage = require('webpage');\r\n    var system = require('system');\r\n\r\n    var page = webpage.create();\r\n    //page.settings.javascriptEnabled = false;\r\n\r\n    page.onLoadStarted = function() {\r\n        var currentUrl = page.evaluate(function() {\r\n                return window.location.href;\r\n        });\r\n        console.log('Current page ' + currentUrl + ' will gone...');\r\n        console.log('Now loading a new page...');\r\n    };\r\n\r\n    page.onLoadFinished = function(status) {\r\n        console.log('Status: ' + status);\r\n    };\r\n\r\n    page.onResourceError = function(resourceError) {\r\n        console.log('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.url + ')');\r\n        console.log('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString);\r\n    };\r\n\r\n    page.onLoadStarted = function () {\r\n        console.log('page.onLoadStarted');\r\n    };\r\n\r\n    page.onLoadFinished = function (status) {\r\n        console.log('page.onLoadFinished status: ' + status);\r\n    };\r\n\r\n    page.onCallback = function(data) {\r\n        console.log('page.onCallback ', (data && data.event ? data.event.type : ''));\r\n    };\r\n\r\n    page.onInitialized = function() {\r\n        console.log('page.onInitialized');\r\n        page.evaluate(function() {\r\n                var phantomEvents = function (event) {\r\n                        if (typeof window.callPhantom === 'function') {\r\n                                var status = window.callPhantom({\"event\": event\t});\r\n                        }\r\n                }\r\n                document.addEventListener('DOMContentLoaded', phantomEvents, false);\r\n                document.addEventListener('load', phantomEvents, false);\r\n        });\r\n    };\r\n\r\n    page.onUrlChanged = function(targetUrl) {\r\n        console.log('page.onUrlChanged: ' + targetUrl);\r\n    };\r\n\r\n    page.onNavigationRequested = function(url, type, willNavigate, main) {\r\n        console.log('page.onNavigationRequested: ' + url);\r\n    };\r\n\r\n    page.onResourceReceived = function (response) {\r\n    };\r\n\r\n    page.onResourceError = function (resourceError) {\r\n        console.log('onResourceError '+response.url + ' ' + resourceError.errorString)\r\n    };\r\n    page.onError = function(msg, trace) {\r\n        console.log('onError '+msg)\r\n    };\r\n\r\n    page.open(system.args[1], function (status) {\r\n        console.log('Callback ', status);\r\n    });\r\n\r\n\r\nOn PhantomJS 1.9\r\n\r\n    phantomjs test1.js http://ya.ru\r\n    page.onNavigationRequested: http://ya.ru/\r\n    page.onLoadStarted\r\n    page.onNavigationRequested: https://ya.ru/\r\n    page.onUrlChanged: https://ya.ru/\r\n    page.onInitialized\r\n    page.onCallback  DOMContentLoaded\r\n    page.onLoadFinished status: success\r\n    Callback  success\r\n\r\nOn PhantomJS 2.0\r\n\r\n    phantomjs test.js http://ya.ru\r\n    page.onNavigationRequested: http://ya.ru/\r\n    page.onLoadStarted\r\n    page.onNavigationRequested: https://ya.ru/\r\n    page.onUrlChanged: https://ya.ru/\r\n    page.onInitialized\r\n"},"comment":{"url":"https://api.github.com/repos/ariya/phantomjs/issues/comments/167346240","html_url":"https://github.com/ariya/phantomjs/issues/13832#issuecomment-167346240","issue_url":"https://api.github.com/repos/ariya/phantomjs/issues/13832","id":167346240,"user":{"login":"zackw","id":325899,"avatar_url":"https://avatars.githubusercontent.com/u/325899?v=3","gravatar_id":"","url":"https://api.github.com/users/zackw","html_url":"https://github.com/zackw","followers_url":"https://api.github.com/users/zackw/followers","following_url":"https://api.github.com/users/zackw/following{/other_user}","gists_url":"https://api.github.com/users/zackw/gists{/gist_id}","starred_url":"https://api.github.com/users/zackw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zackw/subscriptions","organizations_url":"https://api.github.com/users/zackw/orgs","repos_url":"https://api.github.com/users/zackw/repos","events_url":"https://api.github.com/users/zackw/events{/privacy}","received_events_url":"https://api.github.com/users/zackw/received_events","type":"User","site_admin":false},"created_at":"2015-12-26T16:59:57Z","updated_at":"2015-12-26T16:59:57Z","body":"Thank you for the bug report.  We need more information before we can do anything about it.\r\n\r\n* Your demo uses `test1.js` with PhantomJS 1.9 but `test.js` with 2.0.  Which of these is the script you provided?  Are they the same?  If they are not the same, please send us the one you didn't already send us.\r\n\r\n* `ya.ru` could change at any time and make the problem disappear.  Please provide us with a complete, self-contained HTML page (plus any necessary scripts, CSS, etc) which we could put on a web server we control, point your script at it, and see the problem for ourselves."}}