https://github.com/appium/appium/pull/3402 wd.js implementation can be found at https://github.com/admc/wd/pull/333