Debug a plugin written in JS
Oxygen general issues.
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Debug a plugin written in JS
Hello everyone!
I have a plugin that was developed several years ago in javascript.
It contains a wsAccess.js, a toolbar.js and a plugin.xml file
I don't really get what is the purpose of the wsAccess.js knowing that most of the functions in it are similar to the toolbar.js.
The plugin.xml references both so I guess its author had a clear reason to do that.
However, now that I want to update it, I don't have any way to trace the errors that could occur. I update my js files and after restart my app. Sometimes, the effects are directly visible, sometimes they are not and the plugin doesn't fuction anymore.
I would like to trace and see more what happens in the background but the tutorials. have found are related to java and debugging in Eclipse and IntelliJ, they don't apply to plugins using javascript like those proposed in this folder.
https://github.com/oxygenxml/wsaccess-j ... ree/master
Would you have any tip, video or link to share so that I could better understand how my changes in the code apply or not in the plugin?
I have a plugin that was developed several years ago in javascript.
It contains a wsAccess.js, a toolbar.js and a plugin.xml file
I don't really get what is the purpose of the wsAccess.js knowing that most of the functions in it are similar to the toolbar.js.
The plugin.xml references both so I guess its author had a clear reason to do that.
However, now that I want to update it, I don't have any way to trace the errors that could occur. I update my js files and after restart my app. Sometimes, the effects are directly visible, sometimes they are not and the plugin doesn't fuction anymore.
I would like to trace and see more what happens in the background but the tutorials. have found are related to java and debugging in Eclipse and IntelliJ, they don't apply to plugins using javascript like those proposed in this folder.
https://github.com/oxygenxml/wsaccess-j ... ree/master
Would you have any tip, video or link to share so that I could better understand how my changes in the code apply or not in the plugin?
------
Gaspard
Gaspard
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Debug a plugin written in JS
Hi Gaspard,
How about if you start Oxygen using the "oxygen.bat" script from the Oxygen installation folder? The command prompt should show you the stack trace of all exceptions. You can also use "Packages.java.lang.System.err.println("test");" in the javascript code and it should show up in the console as well.
Other than that, if your plugin will grow in complexity in time maybe you can consider switching to using a Java based plugin instead.
Regards,
Radu
How about if you start Oxygen using the "oxygen.bat" script from the Oxygen installation folder? The command prompt should show you the stack trace of all exceptions. You can also use "Packages.java.lang.System.err.println("test");" in the javascript code and it should show up in the console as well.
Other than that, if your plugin will grow in complexity in time maybe you can consider switching to using a Java based plugin instead.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service