Problem Invoking Safari Debugger with JXA Script

###Problem Invoking Safari Debugger with JXA Script

Anyone else here having a problem getting the Safari Debugger to show/engage when running a JXA script with a “debugger;” statement?

I cannot get Safari Debugger to engage without multiple attempts, like 8-10 times, quitting both Script Editor and Safari between each attempt.

I am running Safari 10.0.3 (11602.4.8.0.1) on macOS 10.11.6.

I would greatly appreciate all feedback, letting me know if it works for you or not, and what versions you are running.


I have followed this process:
[Debugging JXA Scripts with Safari Debugger](https://www.evernote.com/l/ABu9nrsi101Ce4FfWhofVktcD6JMY-ZhGlE)

Here is a test script I have been using, both in a standalone mode, and with the below Macro.

###Test JXA Script
```javascript
'use strict';
(function run() {      // this will auto-run when script is executed

var kmeApp = Application("Keyboard Maestro Engine");
var count = kmeApp.getvariable('DND__Count') || 0;

var resultsReturn = "BEFORE Debugger";

//--------------------
debugger;
//--------------------

resultsReturn = "AFTER Debugger Try# " + count + " at " + (new Date()).toLocaleTimeString();

return resultsReturn;

}  // END of function run()
)();
```


I have this testing macro, which I use to open the test script in Script Editor, increment the count, open Safari, and run the script.

**Testing Workflow:**

1. Make sure both Script Editor and Safari are not running.
2. Run the Macro
3. Observe results (is the Debugger invoked?)
4. Quit Script Debugger without saving
5. Quit Safari

Repeat the workflow until the Debugger is invoked.


###MACRO:   Safari Debugger Test with JXA Script

~~~ VER: 1.0    2017-02-19 ~~~

####DOWNLOAD:
<a class="attachment" href="/uploads/default/original/2X/6/631f370b865db04ff2bb3dc6a7d9e63199a38668.kmmacros">Safari Debugger Test with JXA Script.kmmacros</a> (9.0 KB)

---

###ReleaseNotes
**MACRO SETUP**

* Copy above script and save to this file path:
`~/Documents/Test/TEST Debugger @JXA.scpt`

---

<img src="/uploads/default/original/2X/9/9c96498b81fbd75a7192daca6cfa59387cb27f89.png" width="590" height="1201">