MozillaZine

Can not load jsm's function and objects.

Discuss building things with or for the Mozilla Platform.
gao.peng
 
Posts: 2
Joined: May 18th, 2014, 6:48 pm

Post Posted May 18th, 2014, 10:41 pm

Hi all,

Following is a block issue i met, i'll give out the detail about it.

I want to port Gaia from B2G to mobile Firefox, so that the mobile Firefox can run as a webapp manager on device.
So I modify configure.in file of Gecko and added B2G enable, and compiled a mobile version Firefox with B2G enabled.
Then I run this mobile version Firefox on device, and it can be loaded to about:blank page, but can not load any other pages, so Gaia webapp can not run on this mobile Firefox either.
Then I checked the rootcause, and found when loaded browser.xul, browser.js file run stoped since of meeting "[JavaScript Error: "TypeError: SpatialNavigation is undefined".
SpatialNavigation come from SpatialNavigation.jsm file, then I modify SpatialNavigation.jsm file found.
modify "var SpatialNavigation={ ..." to "this.SpatialNavigation={...", that works well.
but there are much more this kind of values were defined, I can not modify from one by one, and I want to know is that is there's some difference between G2G gecko loading jsm and Firefox gecko loading jsm?

Is there anyboy know about it and give some suggestion?

Many thanks.

LIMPET235
Moderator

User avatar
 
Posts: 37479
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Post Posted May 19th, 2014, 12:25 am

Moving to Mozilla Dev...
Ancient Amateur Astronomer
Win-7-HP/IntelĀ® DualCore-2.0GHz/500G HDD/4 Gig Ram/550Watt PSU/350WattUPS/Firefox-20.0-50.0-56.0.1/T-bird-2.0.0.24/SnagIt-v10.0.1/MWP-7.11.0.
RadioYachting. Conficker Test. (Always choose the "Custom" Install.)

gao.peng
 
Posts: 2
Joined: May 18th, 2014, 6:48 pm

Post Posted May 19th, 2014, 7:01 pm

I tried it acoording page: https://developer.mozilla.org/en-US/doc ... ils.import
added "this", modify from
Components.utils.import("resource://gre/modules/SpatialNavigation.jsm");
to
Components.utils.import("resource://gre/modules/SpatialNavigation.jsm", this);
but still can not fix it.

Anyone can give some suggestions?
Many thanks.

Return to Mozilla Development


Who is online

Users browsing this forum: No registered users and 2 guests