Mnus Posted November 1, 2017 Share Posted November 1, 2017 Cu.import("resource://gre/modules/NewTabUtils.jsm"); var { links: gLinks, allPages: gAllPages, linkChecker: gLinkChecker, pinnedLinks: gPinnedLinks, blockedLinks: gBlockedLinks, gridPrefs: gGridPrefs } = NewTabUtils; and the scipt of NewTabUtils.jsm is /** * Singleton that provides the public API of this JSM. */ this.NewTabUtils = { a_Property_is_here: false, Some_Method_A: function Some_Method_A() { } Some_Method_B: function Some_Method_A() { } And_so_on: function And_so_on() { } links: Links, allPages: AllPages, linkChecker: LinkChecker, pinnedLinks: PinnedLinks, blockedLinks: BlockedLinks, gridPrefs: GridPrefs, placesProvider: PlacesProvider, activityStreamLinks: ActivityStreamLinks, activityStreamProvider: ActivityStreamProvider }; What does the part "var{properties}=NewTabUtils;" mean? I understand if that's "NewTabUtils={properties};" And another minor question is about the second script, in the Class-like JS methods, properties are asigned at bottom of the script, also bottom of the file. I guess that's because it is easy to read, but not sure the reason. Would somebody know these questions? thanks. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 2, 2017 Share Posted November 2, 2017 That syntax doesn't look valid. What is that for, does that get run through an interpreter or something to produce regular Javascript? What is .jsm? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now