Comments (10)
👍
from slimerjs.
Since slimerjs is basically a xulrunner application, it should be easy to remotely debug it. I have tried to do it according to the instructions under https://developer.mozilla.org/en-US/docs/Mozilla/Projects/XULRunner/Debugging_XULRunner_applications
I have tried it under Windows 7. To do this, I first unzipped the omni.ja file into the slimerjs installation directory. Then, following the abovementioned instructions, I added the code to start the DebuggerServer to the file chrome\slimerjs\content\slimerjs.js and the debugging preferences to the file defaults\preferences\prefs.js. This always enables remote debugging, so no additional startup parameters are needed.
When I start slimerjs from the command line, I can see with netstat, that the xulrunner process indeed listens on port 6000. When I then try to connect to port 6000 from the firefox debugger, it loads and loads and eventually it gets a timeout.
As a counter- test I created a trivial "Hello World"- like xul application and was able to remotely debug it on port 6000, so I can exclude any network misconfiguration problems. When I try to connect to the "Hello World"- application, it shows a popup box saying "do you want to allow remote debugging of this program?". When I confirm, the program appears in the debugger.
On the other hand, such a popup box does not appear when I try to connect to the abovementioned slimerjs application modified for remote debugging. So, my question is: does anything in slimerjs prevent such popup boxes from appearing? Or any other ideas?
from slimerjs.
Probably because Slimerjs catch all popup for webpage callbacks.
Try by setting this pref to false: devtools.debugger.prompt-connection.
Even it works, it will not be enough. It will be ok to debug SlimerJS itself, but not the script (let's say example.js) given to SlimerJS. First because it is external to SlimerJS code, so it will not be listed into the debugger. Second because the example.js is executed immediately, so we won't have time to set a break point for example.
For the first issue, I guess we have to "configure" the debugger server, by developping an "actor" which will give a list of scripts containing example.js and all others JS/CoffeeScript that are in the same directory (and probably sub-directory).
For the second issue, when there is the --remote-debugger parameter, we could display a button to launch the execution of example.js instead of executing it directly.
I see also an other issue : if we execute step by step a script, and we want to "enter" in a script loaded by require(), if we do nothing, the debugger will enter in the code of require() first. This will not be very friendly as the code may be complex. We should be able to enter directly into the loaded script. So we should find a way to tell to the debugger "do not enter into native function of slimerjs" and "if the function is require, enter directly into the script xxxx.js".
However, I don't know enough how the debugger and its actors work to tell how to fix all of these issues.
from slimerjs.
I just tried to set devtools.debugger.prompt-connection to false and it solves my problem!
My script is listed in the debugger and I can debug it normally. In my script I start the webserver and I want to debug the callbacks that process the requests. Of course, I am unable to debug the code that is executed before the server is started, but the callbacks are perfectly debuggable and that is all I want.
Thank you for the advice!
from slimerjs.
Btw., to address your two issues:
to solve the first one, the developer has to write, only for development purposes, a script that displays a window with a button that on click starts the "real" script. Then it should be all debuggable. In production environment only the "real" script will be started.
As for the second one: this is a general xulrunner problem and is not specific to slimerjs, so we do not need to solve it here.
from slimerjs.
it solves my problem!
Cool!
My script is listed in the debugger and I can debug it normally.
I think it is listed because it has been loaded and executed.
this is a general xulrunner problem
Are you sure? perhaps we could specify some things to the debugger server object, could we?
from slimerjs.
👍
from slimerjs.
I followed instructions provided by @awinizki to enable remote debugging for SlimerJS. I can see a port open on my machine. But when I try to connect from Firefox debugger I get the error message "Unexpected error." I am using Firefox Developer Edition 45.
How can I proceed to look into the issue? My aim is to inspect DOM objects in page using web developer tools' inspector.
from slimerjs.
@xolve This seems to be a limitation of Gecko 44 and up. See issue #510.
from slimerjs.
Debugger server cannot be used anymore in XUL app :-/ https://bugzilla.mozilla.org/show_bug.cgi?id=1244163
from slimerjs.
Related Issues (20)
- Documentation improvement: major difference between the behaviour of evaluateJavaScript in PhantomJS VS SlimerJS
- Is it possible to use with remote running firefox instance?
- when will FF 61 be supported? HOT 1
- segmentation fault errors
- how to access browser default popup?
- SlimerJS not compatible with Firefox 62 HOT 5
- SlimerJS not compatible with Firefox 63 HOT 11
- slimer 1.0.0 leaves a lot of garbage in /tmp HOT 1
- Can't render this site, https://piaofang.maoyan.com/dashboard
- Cannot delete window.callPhantom HOT 1
- Strange bash script behaviour on Heroku
- Script won't work if modules aren't ended with semicolons before async handler HOT 1
- SlimerJS crashes on Windows Server with Firefox 67 HOT 1
- I need each script to connect to a different proxy
- 'expires' attribute from page.cookies is incorrect
- Arch/Manjaro package manager can not download from download.slimerjs.org HOT 1
- Appropriate version of firefox for slimerjs on a raspberry pi? HOT 2
- No more development on Slimerjs HOT 1
- Thumbnail is not generating for video assets
- Crash Annotation GraphicsCriticalError for headless selenium on firefox browser HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slimerjs.