-
Notifications
You must be signed in to change notification settings - Fork 5.7k
PhantomJS 2 remote debugging is broken #12864
Comments
The remote debugger works on Ubuntu with the latest PhantomJS master built from source, but the links to the webkit inspector are broken. What's the HTML source of http://127.0.0.1:8080 ? For me it's: <html><head><title>Remote Web Inspector</title></head><body><ul>
<li><a href="/webkit/inspector/inspector.html?page=1"></li>
</ul></body></html> The link http://localhost:8080/webkit/inspector/inspector.html?page=1 though works on Ubuntu, maybe it's more broken on Windows. |
With http://127.0.0.1:8080 I'm getting exactly the same HTML source that you are getting. |
Confirmed. |
Fixed in #12899 |
I don't think this is fixing the problem (tested in Windows only). Remote debugger inspector page still not shows about:blank link. This time opening http://127.0.0.1:8080/webkit/inspector/inspector.html?page=1 in Chrome will load inspector page, so no more 404 code, but debugging is still not working. You can't set proper breakpoints inside __run function (or you can but they are ignored), though you can execute script with __run() call from console. I also noticed that GUI is different from what we had in PhantomJS 1.9 (probably because of newer WebKit version). |
This is workaround that works for me, in utils.cpp replace loadJSForDebug with this: bool loadJSForDebug(const QString& jsFilePath, const QString &jsFileLanguage, const Encoding& jsFileEnc, const QString& libraryPath, QWebFrame* targetFrame, const bool autorun)
{
QString scriptPath = findScript(jsFilePath, libraryPath);
QString scriptBody = jsFromScriptFile(scriptPath, jsFileLanguage, jsFileEnc);
if (!autorun) {
scriptBody = "function __run() {\n" + scriptBody + "\n}";
}
targetFrame->evaluateJavaScript(scriptBody, QString("debugger"));
return true;
} Then while remote debugging there will be (no domain) item in Sources panel and inside of it will be debugger from where you can properly set breakpoints. Also for me this debugger page is accessible and can be seen only using arrow keys and not by mouse. |
@iradul can you please show me a small example? In my case I can debug JS code (on Windows). |
Using PhantomJS 2.0 binary built from source (remote debugging with binary from website doesn't work at all) and running remote debugger on this test.js script: require('webpage').create().open('http://google.com', function() {
console.log('ok!');
phantom.exit();
});
with Google Chrome I'm getting this: Now if I open http://localhost:8080/webkit/inspector/inspector.html?page=1 manually see below: I'm getting same behavior on 3 different Windows 7 machines. |
@vitallium With your check-in in 2.0 branch (to include Web Inspector resource, from around Jan 24), I assume this issue is fully addressed? If yes, then probably it's a good idea for us to roll out 2.0.1 with this fix. |
@vitallium Those can still go to 2.1, don't they? |
@ariya I think so. |
Can anyone confirm that the changes done in February fix the reported issue? Has anybody else tried to buld PhantomJS from sources - and saw a working debugger? |
Issue is not completely fixed, as I explained here. |
One idea when PhantomJS Release 2.0.1 will be available to download? |
Still seeing the issues that @iradul was seeing on Feb 5th. Any ETA on 2.0.1? |
As @iradul suggested, simplify resource loading in remote debug mode. After this change we don't need remote_debugger_harness.html anymore. And breakpoints will work now again. Issue ariya#12864
You should not use |
I think this is a dupe issue which is open. I ran:
and
Breakpoints are still not being hit and __run() does not output anything. |
I'm seeing the same thing, the console doesn't actually run the |
Same issue. |
I have also verified that this failed on using Chrome and Firefox but works with Safari |
@wgiroir what OS are you using? I couldn't get it working on Safari on Win7. |
I'm safari + OSX |
I was running Safari on OSX and phantomjs on CentOS 7 |
I could run the debug using a very old Chrome version (Chrome 17) that I download here (run sandboxie-d as I can't confirm the procedence of it, although it worked with me - do not use it for browsing, use it for debugging your PhantomJS scripts only). |
Arora works for me! It's a browser based on Qt and WebKit and displays pages like Safari does. I tried Chrome on Ubuntu 16.10 as well as Safari 5.0.5 in Wine but Arora is (so far) the only browser that executes |
Any word on this? I'm running PhantomJS 2.1.1 on OSX and the debugger simply doesn't work in any browser I try. I get the same thing others have reported: Entering the |
For those like me still having trouble, I've found that using an old version of Chromium works well, if your default browser is Chrome. Here's a link to a 2014 build of Chromium that I've had luck getting to work with PhantomJS's remote debugger: https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Mac%2F280075%2Fchrome-mac.zip?generation=1409176787550000&alt=media |
@lewisd, I can confirm I can get chrome debugger to work in the old Chromium version. Will try and understand why this is and post on here if I find anything. I have been looking for other remote debugging breakpoint options for casperjs and will post here if I find anything that works as well. Seems like we need to add support for latest Chrome though. |
For those who use Code editor, you can use PhantomJS debugger extension. |
This is because the protocol used by Chrome changed after the Webkit- Blink engine split. |
This issue should be re-opened, no? |
@jumoreno, hmm never tested on Mac but should be straight forward if you follow steps from documentation, check those out: |
@jumoreno Also on a Mac it should work using Safari since IIRC it still uses the same protocol (WebKit based) |
This must help: node-inspector/node-inspector#951 (comment) |
anyone have workaround for this problem? |
@mingjunz, two workrounds:
|
Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution! |
I had the same issue and was having a hard time finding chrome 50.x Disclaimer: The below project helped me get this easily. Utilize it in case you need any other version of chrome. |
After running phantomjs with --remote-debugger-port=8080 and trying to debug with Google Chrome (Version 39.0.2171.95) "about:blank" link is missing. Also I tried to forcefully go to http://127.0.0.1:8080/webkit/inspector/inspector.html?page=1 but that produces empty page with no debugging capabilities.
Tested on Windows 7 with PhantomJS 2.0 built from source.
The text was updated successfully, but these errors were encountered: