Did you try simplifying this to just:

```python
return self.marionette.execute_script("return window.navigator.mozWifiManager && "
                                      "window.navigator.mozWifiManager.enabled;")
```