There is currently a check in the main Javascript module to actually run the code, but it is still loaded. This can be done in WikispeechHooks::onBeforePageDisplay() and should check namespace and if the latest revision is viewed (listening to earlier revisions is currently not possible but JS still gets loaded).
To do:
- Only load JS if actually needed
- Ensure all cases which prevents listening also prevent JS loading (e.g. namespace, user-rights, user has disabled Wikispeech etc.)