Hello,
Eclipse allows you debug applets using sun.applet.AppletViewer. It will actually start the applet, run it and emulate complete browser runtime. If you have javascript manipulation code in your applet this will cause JSException because the present context is not a real JS enabled engine.
How would you solve this issue? I can see several possible paths:
- Wrap the exception in try {} catch () and ignore it - Not good practice.
- Pass and environment flag that would tell the code we are currently in debug mode, so that it won't try to execute JS code - OK but will need manual intervention from each developer.
- Identify current context is not a browser - How?
- Find another AppletViewer that can emulate a complete browser behavior, including JS - Is there ?
- More?
Thank for your ideas.