Try to use CustomEvent. If not available, use createEvent. Finally return false.

The previous commits broke the script for Firefox on Android and FirefoxOS. Since they don't have support for createEvent.

I've moved the "return false" statement to the "if..else" sentences that detects CustomEvent and createEvent.