Update TaskScheduler.js

dispatch event on document - to fake system events