Listen for onCompleted rather than onCommitted for script reinjection

Fixes #16