mozilla / r2d2b2g

Firefox OS Simulator is a test environment for Firefox OS. Use it to test your apps in a Firefox OS-like environment that looks and feels like a mobile phone.
https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/
Other
392 stars 139 forks source link

FIX: copy gaia/profile-debug/user.js to addon/template/profile #852

Closed rpl closed 10 years ago

rpl commented 10 years ago

Gaia user preferences generated by "gaia/build/preferences.js" are now located on "gaia/profile-debug/user.js" and needs to be copied over "addon/template/profile/user.js" to activate custom desktop-helper preferences.

b2g-desktops doesn't enable dom.w3c_touch_events by default, and if the preference is not set to 1, "document.createEvent('touchevent')" raise a NotSupportedError:

console.error: fxos_1_2_simulator:
JavaScript error: chrome://desktop-helper.js/content/touch-events.js, line 167: 
NotSupportedError: Operation is not supported

Using "dom.w3c_touch_events.enabled=1" fix the exception and "chrome://desktop-helper.js/content/touch-events.js" emulation helper works again (e.g. the FirefoxOS statusbar can be dragged again).

Reported on:

Tested on:

ochameau commented 10 years ago

Oh that's weird, gaia's build system should be setting this pref over here: https://github.com/mozilla-b2g/gaia/blob/master/build/preferences.js#L70 And this block should be executing as we pass the DESKTOP=1 flag there: https://github.com/mozilla/r2d2b2g/blob/master/Makefile#L146

rpl commented 10 years ago

@ochameau I see, I'll look deeper into the building process to detect why it doesn't set the preference as expected

rpl commented 10 years ago

@ochameau Got it ;-)

Gaia user preferences generated by "gaia/build/preferences.js" are now located on "gaia/profile-debug/user.js" and needs to be copied over "addon/template/profile/user.js" to activate custom desktop-helper preferences.

In e4d2239 I've pushed the correct fix (a minimal Makefile tweak)

ochameau commented 10 years ago

Great! Thanks for figuring this out so quickly :-)

Btw, with this patch you are fixing this bugzilla ticket: https://bugzilla.mozilla.org/show_bug.cgi?id=926540