From https://github.com/acmoon/slimerjs/blob/master/src/slimerjs