Debugging Plugins

Note: Available in v3.0.26 and only works with the development version of NotePlan where the provisioning UUID of your device is added. Unfortunately, Apple doesn't allow it with release versions and development versions run only on allowed devices. Reach out on Discord, if you are a plugin developer and want to debug. 

You can debug your plugin JavaScript code using Safari on Mac and iOS. Use breakpoints, walk through the code, inspect variables, and call functions.

Enable Debugging

  1. Open Safari
  2. Open the preferences and enable under "Advanced" the "Develop menu bar
  3. Now you should see the "Develop" menu bar item. Open it, find your Mac or iOS device, and enable "Automatically Show Web Inspector for JSContexts" and "Automatically Pause Connecting to JSContexts".

Start Debugging

Open NotePlan and launch the plugin through the Command Bar or Plugin menu bar. The Web Inspector from Safari should automatically launch and takes a few seconds to connect. It can take 10-15 seconds. Then you should see the JavaScript file on the left under "Sources":

Keep this window open, select the JavaScript file, look for the function you want to debug, and select a breakpoint:

Without closing this window, launch the plugin again. It will open a new Web Inspector, but this time it will connect immediately and you can jump to the breakpoint. If it doesn't behave like this right away, set the breakpoint again and try to launch the plugin again:

Next up: Releasing a plugin →

Jump to: