michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components; michael@0: const { Services } = Cu.import('resource://gre/modules/Services.jsm'); michael@0: const { SystemAppProxy } = Cu.import('resource://gre/modules/SystemAppProxy.jsm'); michael@0: michael@0: addMessageListener('init-chrome-event', function(message) { michael@0: // listen mozChromeEvent and forward to content process. michael@0: let type = message.type; michael@0: michael@0: SystemAppProxy.addEventListener('mozChromeEvent', function(event) { michael@0: let details = event.detail; michael@0: if (details.type === type) { michael@0: sendAsyncMessage('chrome-event', details); michael@0: } michael@0: }, true); michael@0: });