Fix browser-based webdriverjs for Firefox.

Fixes issue 6097.