src/simulate.js: Replace webkit-incompatible code