Bug 986329 - Fix test_settings_XXX.py with JavascriptException:

Revert the previous bad code and update it with @davehunt proposal