Backed out 79 changesets (bug 1524687, bug 1524688) for crashes on mozilla::dom::ScreenOrientation::ScreenOrientation(nsPIDOMWindowInner *,nsScreen *). CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Thu, 14 Feb 2019 11:50:23 +0200
changeset 459077 3b1b94e39795d5af17da5908ad8d05e7cefb89e5
parent 459076 68a001a424062bc60dd8ed56ae263162f1d56d6c
child 459078 322de2cc80194c4fe859989738f7c3c2b70b98a4
push id111915
push userncsoregi@mozilla.com
push dateThu, 14 Feb 2019 09:51:06 +0000
treeherdermozilla-inbound@3b1b94e39795 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1524687, 1524688
milestone67.0a1
backs out68a001a424062bc60dd8ed56ae263162f1d56d6c
328de611bcd3d1433140603488b131ae1c859236
68cffca6927a90ace041bd3f938954fab0d0c586
81dc12cc9257ba9c8f2eef578d99b142220b37a3
c7c49f64048fcab4b5d010275b58ea7ff93a17c9
fb23a0271da0a68f19dcb12410a67dd127a05a4a
0c1d1248e59ed6390e108dd1809627589c52c618
9e9ec7de41608a0752ae3867c7e77b034662ecb2
de0b9993bd5dceae296dfe863ea2455d15e2f6f1
92877cf4fe33df2706fd03ad472f304da03482e5
b4938f2ff8fd9f3af3914a1eefa991ab1c174706
230d2feaf941443d88f9f5f65048c53d70e59b86
6c63bc2409729cf175b319cfb7cd95850aa1ab46
0ad5465eace1f9294f87ae8c705db322d5cfe953
1e75ce91029b4eb030071e9802cd0bdbad59b9cf
34a978503b1d411bcd1483b142fa8260d94d5870
183602e8a30b527608f2c862601abd83f275e636
12a9135dc005ca160564e968d7628803579ce2c9
978ef5dac9db2c03f10ef68d093c8780538b995e
28105bf7bf6a823ee2ec2baec25a881d8965b976
a9fb74beaf2b79c1a291dc223154815884fcb721
fe106b369a722814e2cfa3597ba1295f6deeae9e
e657e77d427124d39a80fa5418a76bbba02d479c
09f626870ad036d0fcce32337ea1670dd96f7ef1
fe9b6695212ec3960ab9e730ccc446a8c3da9375
995ea188bc31942f9f34e156c098e69a9fe3e1a4
01c4d3edb1b036819a562ab10844c9cb9f28dd9e
1bb7dfbb9f48342377604a309ef4cdfcc21f8e13
56c61e0a1f45442c854424598801d5616009621c
c819943ff4662c90150edcffa939d0bc4d7b99d3
a1dd5cec066e3d7ede0fa78b6afae04da897d1a3
517838ee0c3cb67ecba24d826179dce8a367e628
f509a5759fdf1062844c10edf2c26da48b7424e1
56f5c8f0d708a356efc8ecac09993216e73ae539
5746311ef859095112efbc8a6b782eb3665d9102
df02f7d2521223ab89a886f7b9ba5858f3e94f37
c9846136d105b809a859e63d95cd74c23ee7dd2c
2bd48db9cd0f95047e38cb64746ed07191c052c8
ff120b4eeb79dac8a4d69168521386947ac3de83
fe583e7aae8d620c45a4a3638dea4d602d59e513
18f156d6355adadcce5dbb98ed9a9415e52a9684
f4eaebbe2e0f424d9063dae50158bf53cb32781f
bf6b18e23f69cfc3b29560ae39cbd58e6b16ea6c
dd89eb7e9b0d03d762b6bec4e90f5a956cdbe803
4cbbb367ba0b558299e7a8fcb0bea092223cc831
4ed0cf6be580167cfa4203a916179eb9e63f177c
d8efb5ed62b1acc9b4532ad63942adca75804a58
ea347d57d73aca17f002b7d2ad9419175f889fb6
911689ef9f33dbe026bad0c7e3d6ed4f030d6f29
28670fdc418d846f6cd9fcfeeff5f54d86efd9f8
38e1e42a0fb010f7dc15df14cfbe4e8d7a897165
35a5f031dd1e63869a24f64d555743b85b5c1e83
b586d55d76d5012f0e4a471f4c207a8ae09cc393
6dcacead17466ab4372253134218e0ea7b60f4da
9895239d8ac64bef30e5f6390f18456ffe209e4e
25f982fd53bdbe1cf0b497fe7cc989928b9b0ac8
4fb0f0a59fe22e150f1217d5558fed909f98259a
fdc6c4ed241a50b756e77560bc22d2cbd13c684e
5ce5986068f031ac17eb43ff278d30b81acdb73c
ab64ed7388ae516d1a33206399712f3e8860c087
56607c5a301a788f048fc3263027d2ca7ee6a138
6b3684e7d8f95c7d028fcf27d1570675a8ccbbef
ee28258a5724d708770adb03e5f31b37f7abcab2
9201a7ea3c543310df1612b57ab72b883c94e07e
d5dca413e2da67db3f7d52aefc669dd5d62c1142
68eb174a337b20e64583ae8afd45d479a3f54b61
625f71135038f79c075f758e316fbb00097c9a18
46e13c453538f73dd063284804582e5f74c1432a
614be688767fed0d16362dc5fbf0d34fc3c65579
9c24919ac5c2056255dec5725af1fa1548f29ca2
b9862758b98ccb95e90901258bcea159784c7483
92d9e927deec9628ddbde16238debccc10b93b3b
f4ee175bc5bda170021c09456819bc9daeea6408
191afe83da2e062951a2740d7cab68cf563ecfc7
c58caf41bb942d24efb5e108cdb7811be2930498
df95a56dae044a9d8c6a5b449b2c6db4365806b7
10c69df4444dd5b5410ea8716404c14721afa925
219b84a58f506a6b42d23f234e6a8f32e3c3da6c
e96e61bd282f3f6261709ba6cdc473713dadacb7
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 79 changesets (bug 1524687, bug 1524688) for crashes on mozilla::dom::ScreenOrientation::ScreenOrientation(nsPIDOMWindowInner *,nsScreen *). CLOSED TREE Backed out changeset 68a001a42406 (bug 1524687) Backed out changeset 328de611bcd3 (bug 1524688) Backed out changeset 68cffca6927a (bug 1524687) Backed out changeset 81dc12cc9257 (bug 1524688) Backed out changeset c7c49f64048f (bug 1524688) Backed out changeset fb23a0271da0 (bug 1524688) Backed out changeset 0c1d1248e59e (bug 1524688) Backed out changeset 9e9ec7de4160 (bug 1524688) Backed out changeset de0b9993bd5d (bug 1524688) Backed out changeset 92877cf4fe33 (bug 1524688) Backed out changeset b4938f2ff8fd (bug 1524688) Backed out changeset 230d2feaf941 (bug 1524688) Backed out changeset 6c63bc240972 (bug 1524688) Backed out changeset 0ad5465eace1 (bug 1524688) Backed out changeset 1e75ce91029b (bug 1524688) Backed out changeset 34a978503b1d (bug 1524688) Backed out changeset 183602e8a30b (bug 1524688) Backed out changeset 12a9135dc005 (bug 1524688) Backed out changeset 978ef5dac9db (bug 1524688) Backed out changeset 28105bf7bf6a (bug 1524688) Backed out changeset a9fb74beaf2b (bug 1524688) Backed out changeset fe106b369a72 (bug 1524688) Backed out changeset e657e77d4271 (bug 1524688) Backed out changeset 09f626870ad0 (bug 1524688) Backed out changeset fe9b6695212e (bug 1524688) Backed out changeset 995ea188bc31 (bug 1524688) Backed out changeset 01c4d3edb1b0 (bug 1524688) Backed out changeset 1bb7dfbb9f48 (bug 1524688) Backed out changeset 56c61e0a1f45 (bug 1524688) Backed out changeset c819943ff466 (bug 1524688) Backed out changeset a1dd5cec066e (bug 1524688) Backed out changeset 517838ee0c3c (bug 1524688) Backed out changeset f509a5759fdf (bug 1524688) Backed out changeset 56f5c8f0d708 (bug 1524688) Backed out changeset 5746311ef859 (bug 1524688) Backed out changeset df02f7d25212 (bug 1524688) Backed out changeset c9846136d105 (bug 1524688) Backed out changeset 2bd48db9cd0f (bug 1524688) Backed out changeset ff120b4eeb79 (bug 1524688) Backed out changeset fe583e7aae8d (bug 1524688) Backed out changeset 18f156d6355a (bug 1524688) Backed out changeset f4eaebbe2e0f (bug 1524688) Backed out changeset bf6b18e23f69 (bug 1524688) Backed out changeset dd89eb7e9b0d (bug 1524688) Backed out changeset 4cbbb367ba0b (bug 1524688) Backed out changeset 4ed0cf6be580 (bug 1524688) Backed out changeset d8efb5ed62b1 (bug 1524688) Backed out changeset ea347d57d73a (bug 1524688) Backed out changeset 911689ef9f33 (bug 1524688) Backed out changeset 28670fdc418d (bug 1524688) Backed out changeset 38e1e42a0fb0 (bug 1524688) Backed out changeset 35a5f031dd1e (bug 1524688) Backed out changeset b586d55d76d5 (bug 1524688) Backed out changeset 6dcacead1746 (bug 1524688) Backed out changeset 9895239d8ac6 (bug 1524688) Backed out changeset 25f982fd53bd (bug 1524688) Backed out changeset 4fb0f0a59fe2 (bug 1524688) Backed out changeset fdc6c4ed241a (bug 1524688) Backed out changeset 5ce5986068f0 (bug 1524688) Backed out changeset ab64ed7388ae (bug 1524688) Backed out changeset 56607c5a301a (bug 1524688) Backed out changeset 6b3684e7d8f9 (bug 1524688) Backed out changeset ee28258a5724 (bug 1524688) Backed out changeset 9201a7ea3c54 (bug 1524688) Backed out changeset d5dca413e2da (bug 1524688) Backed out changeset 68eb174a337b (bug 1524688) Backed out changeset 625f71135038 (bug 1524687) Backed out changeset 46e13c453538 (bug 1524687) Backed out changeset 614be688767f (bug 1524687) Backed out changeset 9c24919ac5c2 (bug 1524687) Backed out changeset b9862758b98c (bug 1524687) Backed out changeset 92d9e927deec (bug 1524687) Backed out changeset f4ee175bc5bd (bug 1524687) Backed out changeset 191afe83da2e (bug 1524687) Backed out changeset c58caf41bb94 (bug 1524687) Backed out changeset df95a56dae04 (bug 1524687) Backed out changeset 10c69df4444d (bug 1524687) Backed out changeset 219b84a58f50 (bug 1524687) Backed out changeset e96e61bd282f (bug 1524687)
browser/base/content/browser.js
browser/base/content/test/performance/browser_startup.js
browser/base/content/test/performance/browser_startup_content.js
browser/base/content/test/static/browser_all_files_referenced.js
browser/components/BrowserComponents.manifest
browser/components/BrowserContentHandler.jsm
browser/components/BrowserGlue.jsm
browser/components/about/components.conf
browser/components/about/moz.build
browser/components/build/components.conf
browser/components/build/moz.build
browser/components/build/nsBrowserCompsCID.h
browser/components/build/nsModule.cpp
browser/components/components.conf
browser/components/migration/360seProfileMigrator.js
browser/components/migration/360seProfileMigrator.jsm
browser/components/migration/BrowserProfileMigrators.manifest
browser/components/migration/ChromeProfileMigrator.js
browser/components/migration/ChromeProfileMigrator.jsm
browser/components/migration/EdgeProfileMigrator.js
browser/components/migration/EdgeProfileMigrator.jsm
browser/components/migration/FirefoxProfileMigrator.js
browser/components/migration/FirefoxProfileMigrator.jsm
browser/components/migration/IEProfileMigrator.js
browser/components/migration/IEProfileMigrator.jsm
browser/components/migration/ProfileMigrator.js
browser/components/migration/ProfileMigrator.jsm
browser/components/migration/SafariProfileMigrator.js
browser/components/migration/SafariProfileMigrator.jsm
browser/components/migration/components.conf
browser/components/migration/moz.build
browser/components/moz.build
browser/components/newtab/AboutNewTabService.jsm
browser/components/newtab/NewTabComponents.manifest
browser/components/newtab/aboutNewTabService.js
browser/components/newtab/components.conf
browser/components/newtab/moz.build
browser/components/nsBrowserContentHandler.js
browser/components/nsBrowserGlue.js
browser/components/payments/PaymentUIService.jsm
browser/components/payments/components.conf
browser/components/payments/moz.build
browser/components/payments/paymentUIService.js
browser/components/payments/payments.manifest
browser/components/preferences/in-content/tests/browser_advanced_update.js
browser/components/protocolhandler/WebProtocolHandlerRegistrar.js
browser/components/protocolhandler/WebProtocolHandlerRegistrar.jsm
browser/components/protocolhandler/components.conf
browser/components/protocolhandler/moz.build
browser/components/shell/nsWindowsShellService.cpp
browser/components/tests/browser/browser_bug538331.js
browser/components/tests/startupRecorder.js
browser/extensions/pdfjs/components.conf
browser/extensions/pdfjs/content/PdfJs.jsm
browser/extensions/pdfjs/moz.build
browser/extensions/pdfjs/pdfjs.js
browser/extensions/pdfjs/pdfjs.manifest
browser/installer/package-manifest.in
browser/modules/ContentClick.jsm
browser/modules/ContentSearch.jsm
browser/modules/FormValidationHandler.jsm
browser/modules/ReaderParent.jsm
browser/modules/RemotePrompt.jsm
browser/modules/webrtcUI.jsm
browser/themes/shared/compacttheme.inc.css
build/docs/defining-xpcom-components.rst
chrome/test/unit/test_data_protocol_registration.js
chrome/test/unit/test_no_remote_registration.js
devtools/platform/components.conf
devtools/platform/moz.build
devtools/platform/nsJSInspector.cpp
devtools/startup/AboutDebuggingNewRegistration.jsm
devtools/startup/AboutDebuggingRegistration.jsm
devtools/startup/AboutDevToolsToolboxRegistration.jsm
devtools/startup/DevToolsStartup.jsm
devtools/startup/aboutdebugging-new-registration.js
devtools/startup/aboutdebugging-new.manifest
devtools/startup/aboutdebugging-registration.js
devtools/startup/aboutdebugging.manifest
devtools/startup/aboutdevtools/AboutDevToolsRegistration.jsm
devtools/startup/aboutdevtools/aboutdevtools-registration.js
devtools/startup/aboutdevtools/aboutdevtools.manifest
devtools/startup/aboutdevtools/components.conf
devtools/startup/aboutdevtools/moz.build
devtools/startup/aboutdevtoolstoolbox-registration.js
devtools/startup/aboutdevtoolstoolbox.manifest
devtools/startup/components.conf
devtools/startup/devtools-startup.js
devtools/startup/devtools-startup.manifest
devtools/startup/moz.build
dom/base/ContentAreaDropListener.jsm
dom/base/ProcessSelector.js
dom/base/ProcessSelector.jsm
dom/base/ProcessSelector.manifest
dom/base/SlowScriptDebug.js
dom/base/SlowScriptDebug.jsm
dom/base/SlowScriptDebug.manifest
dom/base/components.conf
dom/base/contentAreaDropListener.js
dom/base/contentAreaDropListener.manifest
dom/base/moz.build
dom/base/test/test_bug715041.xul
dom/base/test/test_bug715041_removal.xul
dom/browser-element/BrowserElementParent.js
dom/browser-element/BrowserElementParent.jsm
dom/browser-element/BrowserElementParent.manifest
dom/browser-element/BrowserElementPromptService.jsm
dom/browser-element/components.conf
dom/browser-element/moz.build
dom/console/ConsoleAPI.manifest
dom/console/ConsoleAPIStorage.js
dom/console/ConsoleAPIStorage.jsm
dom/console/components.conf
dom/console/moz.build
dom/file/uri/BlobURLProtocolHandler.cpp
dom/file/uri/FontTableURIProtocolHandler.cpp
dom/file/uri/components.conf
dom/file/uri/moz.build
dom/html/HTMLMenuBuilder.jsm
dom/html/components.conf
dom/html/htmlMenuBuilder.js
dom/html/htmlMenuBuilder.manifest
dom/html/moz.build
dom/media/PeerConnection.js
dom/media/PeerConnection.jsm
dom/media/PeerConnection.manifest
dom/media/bridge/MediaModule.cpp
dom/media/bridge/components.conf
dom/media/bridge/moz.build
dom/media/components.conf
dom/media/moz.build
dom/media/webspeech/synth/moz.build
dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp
dom/media/webspeech/synth/speechd/components.conf
dom/media/webspeech/synth/speechd/moz.build
dom/media/webspeech/synth/test/FakeSynthModule.cpp
dom/media/webspeech/synth/test/components.conf
dom/media/webspeech/synth/test/nsFakeSynthServices.cpp
dom/media/webspeech/synth/test/nsFakeSynthServices.h
dom/notification/NotificationStorage.js
dom/notification/NotificationStorage.jsm
dom/notification/NotificationStorage.manifest
dom/notification/components.conf
dom/notification/moz.build
dom/payments/PaymentRequestModule.cpp
dom/payments/components.conf
dom/payments/moz.build
dom/plugins/base/components.conf
dom/plugins/base/moz.build
dom/plugins/base/nsPluginModule.cpp
dom/presentation/PresentationDataChannelSessionTransport.js
dom/presentation/PresentationDataChannelSessionTransport.jsm
dom/presentation/PresentationDataChannelSessionTransport.manifest
dom/presentation/PresentationNetworkHelper.js
dom/presentation/PresentationNetworkHelper.jsm
dom/presentation/PresentationNetworkHelper.manifest
dom/presentation/components.conf
dom/presentation/moz.build
dom/presentation/provider/AndroidCastDeviceProvider.js
dom/presentation/provider/AndroidCastDeviceProvider.jsm
dom/presentation/provider/AndroidCastDeviceProvider.manifest
dom/presentation/provider/BuiltinProviders.manifest
dom/presentation/provider/PresentationControlService.js
dom/presentation/provider/PresentationControlService.jsm
dom/presentation/provider/PresentationDeviceProviderModule.cpp
dom/presentation/provider/components.conf
dom/presentation/provider/moz.build
dom/presentation/tests/mochitest/PresentationSessionFrameScript.js
dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js
dom/push/Push.js
dom/push/Push.jsm
dom/push/Push.manifest
dom/push/PushComponents.js
dom/push/PushComponents.jsm
dom/push/components.conf
dom/push/moz.build
dom/system/NetworkGeolocationProvider.js
dom/system/NetworkGeolocationProvider.jsm
dom/system/NetworkGeolocationProvider.manifest
dom/system/components.conf
dom/system/moz.build
extensions/cookie/components.conf
extensions/cookie/moz.build
extensions/cookie/nsCookieModule.cpp
extensions/cookie/nsCookieModule.h
extensions/cookie/test/unit/test_permmanager_migrate_4-7_no_history.js
extensions/permissions/components.conf
extensions/permissions/moz.build
extensions/permissions/nsModuleFactory.cpp
extensions/pref/autoconfig/src/components.conf
extensions/pref/autoconfig/src/moz.build
extensions/pref/autoconfig/src/nsConfigFactory.cpp
extensions/spellcheck/hunspell/glue/mozHunspell.cpp
extensions/spellcheck/src/components.conf
extensions/spellcheck/src/moz.build
extensions/spellcheck/src/mozSpellCheckerFactory.cpp
gfx/src/components.conf
gfx/src/moz.build
gfx/src/nsThebesGfxFactory.cpp
gfx/thebes/gfxPlatform.cpp
image/build/components.conf
image/build/moz.build
image/build/nsImageModule.cpp
image/decoders/icon/components.conf
image/decoders/icon/moz.build
image/decoders/icon/nsIconModule.cpp
intl/build/components.conf
intl/build/moz.build
intl/build/nsI18nModule.cpp
intl/locale/components.conf
intl/locale/moz.build
intl/uconv/components.conf
intl/uconv/moz.build
intl/uconv/nsUConvModule.cpp
js/ductwork/debugger/JSDebugger.cpp
js/ductwork/debugger/components.conf
js/ductwork/debugger/moz.build
layout/build/components.conf
layout/tools/recording/RecordingCmdLine.jsm
layout/tools/recording/components.conf
layout/tools/recording/moz.build
layout/tools/recording/recording-cmdline.js
layout/tools/recording/recording-cmdline.manifest
mobile/android/components/BrowserCLH.js
mobile/android/installer/package-manifest.in
modules/libjar/components.conf
modules/libjar/moz.build
modules/libjar/nsJARFactory.cpp
modules/libjar/zipwriter/ZipWriterModule.cpp
modules/libjar/zipwriter/components.conf
modules/libjar/zipwriter/moz.build
modules/libjar/zipwriter/nsDeflateConverter.h
modules/libpref/Preferences.cpp
modules/libpref/Preferences.h
modules/libpref/components.conf
modules/libpref/moz.build
netwerk/dns/mdns/libmdns/DNSServiceDiscovery.jsm
netwerk/dns/mdns/libmdns/components.conf
netwerk/dns/mdns/libmdns/moz.build
netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.js
netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.manifest
netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp
netwerk/protocol/gio/components.conf
netwerk/protocol/gio/moz.build
netwerk/protocol/gio/nsGIOProtocolHandler.cpp
netwerk/protocol/http/UAOverridesBootstrapper.js
netwerk/protocol/http/UAOverridesBootstrapper.jsm
netwerk/protocol/http/UAOverridesBootstrapper.manifest
netwerk/protocol/http/WellKnownOpportunisticUtils.js
netwerk/protocol/http/WellKnownOpportunisticUtils.jsm
netwerk/protocol/http/WellKnownOpportunisticUtils.manifest
netwerk/protocol/http/components.conf
netwerk/protocol/http/moz.build
parser/htmlparser/components.conf
parser/htmlparser/moz.build
python/mozbuild/mozbuild/test/codecoverage/test_lcov_rewrite.py
security/manager/pki/components.conf
security/manager/pki/moz.build
security/manager/pki/nsPKIModule.cpp
security/sandbox/common/SandboxSettings.cpp
security/sandbox/common/components.conf
security/sandbox/common/moz.build
security/sandbox/linux/reporter/SandboxReporterWrappers.cpp
security/sandbox/linux/reporter/components.conf
security/sandbox/linux/reporter/moz.build
services/crypto/component/IdentityCryptoService.cpp
services/crypto/component/components.conf
services/crypto/component/moz.build
services/fxaccounts/FxAccountsComponents.manifest
services/fxaccounts/FxAccountsPush.js
services/fxaccounts/FxAccountsPush.jsm
services/fxaccounts/components.conf
services/fxaccounts/moz.build
services/fxaccounts/tests/xpcshell/test_push_service.js
services/settings/RemoteSettingsComponents.js
services/settings/RemoteSettingsComponents.jsm
services/settings/components.conf
services/settings/moz.build
services/settings/servicesSettings.manifest
services/sync/SyncComponents.manifest
services/sync/Weave.js
services/sync/Weave.jsm
services/sync/components.conf
services/sync/moz.build
storage/build/components.conf
storage/build/moz.build
storage/build/mozStorageModule.cpp
testing/mochitest/tests/SimpleTest/MockObjects.js
testing/specialpowers/content/MockColorPicker.jsm
testing/specialpowers/content/MockFilePicker.jsm
testing/specialpowers/content/specialpowersAPI.js
testing/xpcshell/head.js
toolkit/components/DefaultCLH.jsm
toolkit/components/asyncshutdown/components.conf
toolkit/components/asyncshutdown/moz.build
toolkit/components/asyncshutdown/nsAsyncShutdown.js
toolkit/components/asyncshutdown/nsAsyncShutdown.jsm
toolkit/components/asyncshutdown/nsAsyncShutdown.manifest
toolkit/components/autocomplete/components.conf
toolkit/components/autocomplete/moz.build
toolkit/components/autocomplete/nsAutoCompleteController.cpp
toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp
toolkit/components/autocomplete/nsAutoCompleteSimpleResult.h
toolkit/components/backgroundhangmonitor/BHRTelemetryService.js
toolkit/components/backgroundhangmonitor/BHRTelemetryService.jsm
toolkit/components/backgroundhangmonitor/BHRTelemetryService.manifest
toolkit/components/backgroundhangmonitor/components.conf
toolkit/components/backgroundhangmonitor/moz.build
toolkit/components/browser/build/components.conf
toolkit/components/browser/build/moz.build
toolkit/components/browser/build/nsWebBrowserModule.cpp
toolkit/components/build/nsToolkitCompsCID.h
toolkit/components/captivedetect/CaptiveDetect.jsm
toolkit/components/captivedetect/CaptivePortalDetectComponents.manifest
toolkit/components/captivedetect/captivedetect.js
toolkit/components/captivedetect/components.conf
toolkit/components/captivedetect/moz.build
toolkit/components/cleardata/ClearDataService.js
toolkit/components/cleardata/ClearDataService.jsm
toolkit/components/cleardata/ClearDataService.manifest
toolkit/components/cleardata/components.conf
toolkit/components/cleardata/moz.build
toolkit/components/components.conf
toolkit/components/contentprefs/ContentPrefService2.js
toolkit/components/contentprefs/ContentPrefService2.jsm
toolkit/components/contentprefs/ContentPrefService2.manifest
toolkit/components/contentprefs/ContentPrefServiceParent.jsm
toolkit/components/contentprefs/components.conf
toolkit/components/contentprefs/moz.build
toolkit/components/crashes/CrashService.js
toolkit/components/crashes/CrashService.jsm
toolkit/components/crashes/CrashService.manifest
toolkit/components/crashes/components.conf
toolkit/components/crashes/moz.build
toolkit/components/crashmonitor/components.conf
toolkit/components/crashmonitor/crashmonitor.manifest
toolkit/components/crashmonitor/moz.build
toolkit/components/crashmonitor/nsCrashMonitor.js
toolkit/components/crashmonitor/nsCrashMonitor.jsm
toolkit/components/ctypes/components.conf
toolkit/components/ctypes/ctypes.cpp
toolkit/components/ctypes/moz.build
toolkit/components/downloads/DownloadLegacy.js
toolkit/components/downloads/DownloadLegacy.jsm
toolkit/components/downloads/Downloads.manifest
toolkit/components/downloads/components.conf
toolkit/components/downloads/moz.build
toolkit/components/gfx/GfxSanityTest.manifest
toolkit/components/gfx/SanityTest.js
toolkit/components/gfx/SanityTest.jsm
toolkit/components/gfx/components.conf
toolkit/components/gfx/moz.build
toolkit/components/mediasniffer/components.conf
toolkit/components/mediasniffer/moz.build
toolkit/components/mediasniffer/nsMediaSnifferModule.cpp
toolkit/components/moz.build
toolkit/components/mozintl/MozIntlHelper.cpp
toolkit/components/mozintl/components.conf
toolkit/components/mozintl/moz.build
toolkit/components/mozintl/mozIntl.js
toolkit/components/mozintl/mozIntl.jsm
toolkit/components/mozintl/mozIntl.manifest
toolkit/components/mozprotocol/MozProtocolHandler.jsm
toolkit/components/mozprotocol/components.conf
toolkit/components/mozprotocol/moz.build
toolkit/components/mozprotocol/mozProtocolHandler.js
toolkit/components/mozprotocol/mozProtocolHandler.manifest
toolkit/components/normandy/ShieldContentProcess.jsm
toolkit/components/normandy/components.conf
toolkit/components/normandy/moz.build
toolkit/components/normandy/shield-content-process.js
toolkit/components/normandy/shield.manifest
toolkit/components/nsDefaultCLH.js
toolkit/components/nsDefaultCLH.manifest
toolkit/components/passwordmgr/LoginInfo.jsm
toolkit/components/passwordmgr/LoginManager.jsm
toolkit/components/passwordmgr/LoginManagerParent.jsm
toolkit/components/passwordmgr/LoginManagerPrompter.jsm
toolkit/components/passwordmgr/components.conf
toolkit/components/passwordmgr/crypto-SDR.js
toolkit/components/passwordmgr/moz.build
toolkit/components/passwordmgr/nsLoginInfo.js
toolkit/components/passwordmgr/nsLoginManager.js
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
toolkit/components/passwordmgr/passwordmgr.manifest
toolkit/components/passwordmgr/storage-json.js
toolkit/components/passwordmgr/storage-mozStorage.js
toolkit/components/perf/PerfMeasurement.cpp
toolkit/components/perf/components.conf
toolkit/components/perf/moz.build
toolkit/components/places/ColorAnalyzer.js
toolkit/components/places/ColorAnalyzer.jsm
toolkit/components/places/FaviconHelpers.cpp
toolkit/components/places/PageIconProtocolHandler.js
toolkit/components/places/PageIconProtocolHandler.jsm
toolkit/components/places/PlacesCategoriesStarter.js
toolkit/components/places/PlacesCategoriesStarter.jsm
toolkit/components/places/PlacesExpiration.jsm
toolkit/components/places/TaggingService.jsm
toolkit/components/places/UnifiedComplete.js
toolkit/components/places/UnifiedComplete.jsm
toolkit/components/places/components.conf
toolkit/components/places/moz.build
toolkit/components/places/nsAnnotationService.h
toolkit/components/places/nsFaviconService.cpp
toolkit/components/places/nsFaviconService.h
toolkit/components/places/nsPlacesExpiration.js
toolkit/components/places/nsPlacesModule.cpp
toolkit/components/places/nsTaggingService.js
toolkit/components/places/tests/gtest/places_test_harness_tail.h
toolkit/components/places/toolkitplaces.manifest
toolkit/components/processsingleton/ContentProcessSingleton.js
toolkit/components/processsingleton/ContentProcessSingleton.jsm
toolkit/components/processsingleton/MainProcessSingleton.js
toolkit/components/processsingleton/MainProcessSingleton.jsm
toolkit/components/processsingleton/ProcessSingleton.manifest
toolkit/components/processsingleton/components.conf
toolkit/components/processsingleton/moz.build
toolkit/components/prompts/src/Prompter.jsm
toolkit/components/prompts/src/components.conf
toolkit/components/prompts/src/moz.build
toolkit/components/prompts/src/nsPrompter.js
toolkit/components/prompts/src/nsPrompter.manifest
toolkit/components/reflect/components.conf
toolkit/components/reflect/moz.build
toolkit/components/reflect/reflect.cpp
toolkit/components/remote/components.conf
toolkit/components/remote/moz.build
toolkit/components/remote/nsRemoteService.cpp
toolkit/components/remotebrowserutils/RemoteWebNavigation.js
toolkit/components/remotebrowserutils/RemoteWebNavigation.jsm
toolkit/components/remotebrowserutils/components.conf
toolkit/components/remotebrowserutils/moz.build
toolkit/components/remotebrowserutils/remotebrowserutils.manifest
toolkit/components/satchel/FormAutoComplete.jsm
toolkit/components/satchel/FormHistoryStartup.js
toolkit/components/satchel/FormHistoryStartup.jsm
toolkit/components/satchel/InputListAutoComplete.jsm
toolkit/components/satchel/components.conf
toolkit/components/satchel/moz.build
toolkit/components/satchel/nsFormAutoComplete.js
toolkit/components/satchel/nsFormFillController.cpp
toolkit/components/satchel/nsInputListAutoComplete.js
toolkit/components/satchel/satchel.manifest
toolkit/components/search/SearchService.jsm
toolkit/components/search/SearchSuggestions.jsm
toolkit/components/search/Sidebar.jsm
toolkit/components/search/components.conf
toolkit/components/search/moz.build
toolkit/components/search/nsSearchService.js
toolkit/components/search/nsSearchSuggestions.js
toolkit/components/search/nsSidebar.js
toolkit/components/search/toolkitsearch.manifest
toolkit/components/telemetry/TelemetryStartup.js
toolkit/components/telemetry/TelemetryStartup.jsm
toolkit/components/telemetry/TelemetryStartup.manifest
toolkit/components/telemetry/components.conf
toolkit/components/telemetry/core/Telemetry.cpp
toolkit/components/telemetry/core/Telemetry.h
toolkit/components/telemetry/core/components.conf
toolkit/components/telemetry/hybrid-content/HybridContentTelemetry.jsm
toolkit/components/telemetry/hybrid-content/content-HybridContentTelemetry.js
toolkit/components/telemetry/moz.build
toolkit/components/terminator/TerminatorTelemetry.jsm
toolkit/components/terminator/components.conf
toolkit/components/terminator/moz.build
toolkit/components/terminator/nsTerminatorTelemetry.js
toolkit/components/terminator/terminator.manifest
toolkit/components/thumbnails/PageThumbsComponents.manifest
toolkit/components/thumbnails/PageThumbsStorageService.js
toolkit/components/thumbnails/PageThumbsStorageService.jsm
toolkit/components/thumbnails/components.conf
toolkit/components/thumbnails/moz.build
toolkit/components/thumbnails/nsPageThumbsModule.cpp
toolkit/components/timermanager/UpdateTimerManager.jsm
toolkit/components/timermanager/components.conf
toolkit/components/timermanager/moz.build
toolkit/components/timermanager/nsUpdateTimerManager.js
toolkit/components/timermanager/nsUpdateTimerManager.manifest
toolkit/components/tooltiptext/TooltipTextProvider.js
toolkit/components/tooltiptext/TooltipTextProvider.jsm
toolkit/components/tooltiptext/TooltipTextProvider.manifest
toolkit/components/tooltiptext/components.conf
toolkit/components/tooltiptext/moz.build
toolkit/components/url-classifier/UrlClassifierHashCompleter.jsm
toolkit/components/url-classifier/UrlClassifierLib.jsm
toolkit/components/url-classifier/UrlClassifierListManager.jsm
toolkit/components/url-classifier/components.conf
toolkit/components/url-classifier/moz.build
toolkit/components/url-classifier/nsURLClassifier.manifest
toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
toolkit/components/url-classifier/nsUrlClassifierLib.js
toolkit/components/url-classifier/nsUrlClassifierListManager.js
toolkit/components/urlformatter/URLFormatter.jsm
toolkit/components/urlformatter/components.conf
toolkit/components/urlformatter/moz.build
toolkit/components/urlformatter/nsURLFormatter.js
toolkit/components/urlformatter/nsURLFormatter.manifest
toolkit/components/utils/SimpleServices.jsm
toolkit/components/utils/components.conf
toolkit/components/utils/moz.build
toolkit/components/utils/simpleServices.js
toolkit/components/utils/utils.manifest
toolkit/components/xulstore/XULStore.js
toolkit/components/xulstore/XULStore.jsm
toolkit/components/xulstore/XULStore.manifest
toolkit/components/xulstore/components.conf
toolkit/components/xulstore/moz.build
toolkit/moz.build
toolkit/mozapps/downloads/HelperAppDlg.jsm
toolkit/mozapps/downloads/components.conf
toolkit/mozapps/downloads/moz.build
toolkit/mozapps/downloads/nsHelperAppDlg.js
toolkit/mozapps/downloads/nsHelperAppDlg.manifest
toolkit/mozapps/extensions/addonManager.js
toolkit/mozapps/extensions/amContentHandler.js
toolkit/mozapps/extensions/amContentHandler.jsm
toolkit/mozapps/extensions/amInstallTrigger.js
toolkit/mozapps/extensions/amInstallTrigger.jsm
toolkit/mozapps/extensions/amWebAPI.js
toolkit/mozapps/extensions/amWebAPI.jsm
toolkit/mozapps/extensions/components.conf
toolkit/mozapps/extensions/extensions.manifest
toolkit/mozapps/extensions/moz.build
toolkit/mozapps/handling/ContentDispatchChooser.jsm
toolkit/mozapps/handling/components.conf
toolkit/mozapps/handling/moz.build
toolkit/mozapps/handling/nsContentDispatchChooser.js
toolkit/mozapps/handling/nsContentDispatchChooser.manifest
toolkit/mozapps/update/UpdateService.jsm
toolkit/mozapps/update/UpdateServiceStub.jsm
toolkit/mozapps/update/components.conf
toolkit/mozapps/update/moz.build
toolkit/mozapps/update/nsUpdateService.js
toolkit/mozapps/update/nsUpdateService.manifest
toolkit/mozapps/update/nsUpdateServiceStub.js
toolkit/system/gnome/components.conf
toolkit/system/gnome/moz.build
toolkit/system/gnome/nsGConfService.h
toolkit/system/gnome/nsGnomeModule.cpp
toolkit/system/gnome/nsGnomeModule.h
toolkit/system/unixproxy/components.conf
toolkit/system/unixproxy/moz.build
toolkit/system/unixproxy/nsLibProxySettings.cpp
toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
toolkit/xre/components.conf
toolkit/xre/moz.build
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsAppRunner.h
toolkit/xre/nsEmbeddingModule.cpp
tools/profiler/gecko/components.conf
tools/profiler/gecko/nsProfilerFactory.cpp
tools/profiler/moz.build
uriloader/exthandler/WebHandlerApp.jsm
uriloader/exthandler/components.conf
uriloader/exthandler/moz.build
uriloader/exthandler/nsWebHandlerApp.js
uriloader/exthandler/nsWebHandlerApp.manifest
widget/gtk/components.conf
widget/gtk/moz.build
widget/gtk/nsWidgetFactory.cpp
widget/gtk/nsWidgetFactory.h
widget/moz.build
widget/nsAppShellSingleton.h
widget/nsIIdleService.idl
widget/nsIdleService.cpp
widget/nsIdleService.h
widget/windows/components.conf
widget/windows/moz.build
widget/windows/nsWidgetFactory.cpp
widget/windows/nsWidgetFactory.h
xpcom/components/StaticComponents.cpp.in
xpcom/components/StaticComponents.h
xpcom/components/gen_static_components.py
xpcom/components/nsComponentManager.cpp
xpcom/components/nsComponentManager.h
xpcom/components/nsIComponentManager.idl
xpfe/appshell/components.conf
xpfe/appshell/moz.build
xpfe/appshell/nsAppShellFactory.cpp
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1733,17 +1733,17 @@ var gBrowserInit = {
   /**
    * Use this function as an entry point to schedule tasks that
    * need to run once per window after startup, and can be scheduled
    * by using an idle callback.
    *
    * The functions scheduled here will fire from idle callbacks
    * once every window has finished being restored by session
    * restore, and after the equivalent only-once tasks
-   * have run (from _scheduleStartupIdleTasks in BrowserGlue.jsm).
+   * have run (from _scheduleStartupIdleTasks in nsBrowserGlue.js).
    */
   _schedulePerWindowIdleTasks() {
     // Bail out if the window has been closed in the meantime.
     if (window.closed) {
       return;
     }
 
     function scheduleIdleTask(func, options) {
--- a/browser/base/content/test/performance/browser_startup.js
+++ b/browser/base/content/test/performance/browser_startup.js
@@ -19,29 +19,32 @@
 /* Set this to true only for debugging purpose; it makes the output noisy. */
 const kDumpAllStacks = false;
 
 const startupPhases = {
   // For app-startup, we have a whitelist of acceptable JS files.
   // Anything loaded during app-startup must have a compelling reason
   // to run before we have even selected the user profile.
   // Consider loading your code after first paint instead,
-  // eg. from BrowserGlue.jsm' _onFirstWindowLoaded method).
+  // eg. from nsBrowserGlue.js' _onFirstWindowLoaded method).
   "before profile selection": {whitelist: {
+    components: new Set([
+      "nsBrowserGlue.js",
+      "MainProcessSingleton.js",
+
+      // Bugs to fix: The following components shouldn't be initialized that early.
+      "PushComponents.js", // bug 1369436
+    ]),
     modules: new Set([
-      "resource:///modules/BrowserGlue.jsm",
       "resource://gre/modules/AppConstants.jsm",
       "resource://gre/modules/ActorManagerParent.jsm",
       "resource://gre/modules/CustomElementsListener.jsm",
       "resource://gre/modules/ExtensionUtils.jsm",
-      "resource://gre/modules/MainProcessSingleton.jsm",
       "resource://gre/modules/XPCOMUtils.jsm",
       "resource://gre/modules/Services.jsm",
-      // Bugs to fix: The following components shouldn't be initialized that early.
-      "resource://gre/modules/PushComponents.jsm", // bug 1369436
     ]),
   }},
 
   // For the following phases of startup we have only a black list for now
 
   // We are at this phase after creating the first browser window (ie. after final-ui-startup).
   "before opening first browser window": {blacklist: {
     modules: new Set([
--- a/browser/base/content/test/performance/browser_startup_content.js
+++ b/browser/base/content/test/performance/browser_startup_content.js
@@ -13,23 +13,24 @@
  */
 
 "use strict";
 
 /* Set this to true only for debugging purpose; it makes the output noisy. */
 const kDumpAllStacks = false;
 
 const whitelist = {
+  components: new Set([
+    "ContentProcessSingleton.js",
+  ]),
   modules: new Set([
     "chrome://mochikit/content/ShutdownLeaksCollector.jsm",
     "resource://specialpowers/specialpowers.js",
     "resource://specialpowers/specialpowersAPI.js",
 
-    "resource://gre/modules/ContentProcessSingleton.jsm",
-
     // General utilities
     "resource://gre/modules/AppConstants.jsm",
     "resource://gre/modules/AsyncShutdown.jsm",
     "resource://gre/modules/DeferredTask.jsm",
     "resource://gre/modules/PromiseUtils.jsm",
     "resource://gre/modules/Services.jsm", // bug 1464542
     "resource://gre/modules/Timer.jsm",
     "resource://gre/modules/XPCOMUtils.jsm",
@@ -94,18 +95,20 @@ const whitelist = {
     "data:,new function() {\n      ChromeUtils.import(\"resource://formautofill/FormAutofillContent.jsm\");\n    }",
   ]),
 };
 
 // Items on this list are allowed to be loaded but not
 // required, as opposed to items in the main whitelist,
 // which are all required.
 const intermittently_loaded_whitelist = {
+  components: new Set([
+    "nsAsyncShutdown.js",
+  ]),
   modules: new Set([
-    "resource://gre/modules/nsAsyncShutdown.jsm",
     "resource://gre/modules/sessionstore/Utils.jsm",
   ]),
   frameScripts: new Set([]),
   processScripts: new Set([]),
 };
 
 const blacklist = {
   services: new Set([
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -638,20 +638,16 @@ add_task(async function checkAllTheFiles
     }
 
     return true;
   });
 
   // Wait for all manifest to be parsed
   await throttledMapPromises(manifestURIs, parseManifest);
 
-  for (let jsm of Components.manager.getComponentJSMs()) {
-    gReferencesFromCode.set(jsm, null);
-  }
-
   // manifest.json is a common name, it is used for WebExtension manifests
   // but also for other things.  To tell them apart, we have to actually
   // read the contents.  This will populate gExtensionRoots with all
   // embedded extension APIs, and return any manifest.json files that aren't
   // webextensions.
   let nonWebextManifests = (await Promise.all(jsonManifests.map(parseJsonManifest)))
                                          .filter(uri => !!uri);
   uris.push(...nonWebextManifests);
--- a/browser/components/BrowserComponents.manifest
+++ b/browser/components/BrowserComponents.manifest
@@ -1,10 +1,43 @@
+# nsBrowserContentHandler.js
+component {5d0ce354-df01-421a-83fb-7ead0990c24e} nsBrowserContentHandler.js application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/browser/clh;1 {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+component {47cd0651-b1be-4a0f-b5c4-10e5a573ef71} nsBrowserContentHandler.js application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/browser/final-clh;1 {47cd0651-b1be-4a0f-b5c4-10e5a573ef71} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/html {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.mozilla.xul+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/svg+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/rdf {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=application/xhtml+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/css {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=text/plain {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/gif {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/jpeg {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/jpg {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/png {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/bmp {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/x-icon {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=image/vnd.microsoft.icon {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+contract @mozilla.org/uriloader/content-handler;1?type=application/http-index-format {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+category command-line-handler m-browser @mozilla.org/browser/clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+category command-line-handler x-default @mozilla.org/browser/final-clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+category command-line-validator b-browser @mozilla.org/browser/clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+
 # nsBrowserGlue.js
 
 # This component must restrict its registration for the app-startup category
 # to the specific list of apps that use it so it doesn't get loaded in xpcshell.
 # Thus we restrict it to these apps:
 #
 #   browser:        {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
 #   mobile/android: {aa3c5121-dab2-40e2-81ca-7ea25febc110}
 
+component {eab9012e-5f74-4cbc-b2b5-a590235513cc} nsBrowserGlue.js
+contract @mozilla.org/browser/browserglue;1 {eab9012e-5f74-4cbc-b2b5-a590235513cc}
 category app-startup nsBrowserGlue service,@mozilla.org/browser/browserglue;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} application={aa3c5121-dab2-40e2-81ca-7ea25febc110}
+component {d8903bf6-68d5-4e97-bcd1-e4d3012f721a} nsBrowserGlue.js
+contract @mozilla.org/content-permission/prompt;1 {d8903bf6-68d5-4e97-bcd1-e4d3012f721a}
+
+# RegisterProtocolHandler support
+component {efbd7b87-9b15-4684-abf0-dc2679daadb1} WebProtocolHandlerRegistrar.js process=main
+contract @mozilla.org/embeddor.implemented/web-protocol-handler-registrar;1 {efbd7b87-9b15-4684-abf0-dc2679daadb1} process=main
deleted file mode 100644
--- a/browser/components/about/components.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-pages = [
-    'blocked',
-    'certerror',
-    'config',
-    'downloads',
-    'home',
-    'library',
-    'newinstall',
-    'newtab',
-    'pocket-saved',
-    'pocket-signup',
-    'policies',
-    'preferences',
-    'privatebrowsing',
-    'reader',
-    'restartrequired',
-    'rights',
-    'robots',
-    'searchreset',
-    'sessionrestore',
-    'tabcrashed',
-    'welcome',
-    'welcomeback',
-]
-
-Classes = [
-    {
-        'cid': '{7e4bb6ad-2fc4-4dc6-89ef-23e8e5ccf980}',
-        'contract_ids': ['@mozilla.org/network/protocol/about;1?what=%s' % page
-                         for page in pages],
-        'legacy_constructor': 'mozilla::browser::AboutRedirector::Create',
-        'headers': ['/browser/components/about/AboutRedirector.h'],
-    },
-]
--- a/browser/components/about/moz.build
+++ b/browser/components/about/moz.build
@@ -12,20 +12,16 @@ EXPORTS.mozilla.browser += [
 ]
 
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
 
 SOURCES += [
     'AboutRedirector.cpp',
 ]
 
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
 EXTRA_JS_MODULES.aboutpages = [
     'AboutPrivateBrowsingHandler.jsm',
 ]
 
 FINAL_LIBRARY = 'browsercomps'
 
 LOCAL_INCLUDES += [
     '../build',
deleted file mode 100644
--- a/browser/components/build/components.conf
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{6deb193c-f87d-4078-bc78-5e64655b4d62}',
-        'contract_ids': ['@mozilla.org/browser/directory-provider;1'],
-        'type': 'mozilla::browser::DirectoryProvider',
-        'headers': ['mozilla/browser/DirectoryProvider.h'],
-        'categories': {'xpcom-directory-providers': 'browser-directory-provider'},
-    },
-]
-
-TOOLKIT = buildconfig.substs['MOZ_WIDGET_TOOLKIT']
-
-shell_service_contracts = [
-    '@mozilla.org/browser/shell-service;1',
-    '@mozilla.org/toolkit/shell-service;1',
-]
-
-if TOOLKIT == 'gtk3':
-    Classes += [
-        {
-            'cid': '{63c7b9f4-0cc8-43f8-b666-0a661655cb73}',
-            'contract_ids': shell_service_contracts,
-            'type': 'nsGNOMEShellService',
-            'headers': ['/browser/components/shell/nsGNOMEShellService.h'],
-            'init_method': 'Init',
-        },
-    ]
-elif TOOLKIT == 'cocoa':
-    Classes += [
-        {
-            'cid': '{6fc66a78-6cbc-4b3f-b7ba-379289b29276}',
-            'contract_ids': ['@mozilla.org/mac-attribution;1'],
-            'type': 'nsMacAttributionService',
-            'headers': ['nsMacAttribution.h'],
-        },
-    ]
-
-if buildconfig.substs['OS_ARCH'] == 'Darwin':
-    Classes += [
-        {
-            'cid': '{63c7b9f4-0cc8-43f8-b666-0a661655cb73}',
-            'contract_ids': shell_service_contracts,
-            'type': 'nsMacShellService',
-            'headers': ['/browser/components/shell/nsMacShellService.h'],
-        },
-    ]
-elif buildconfig.substs['OS_ARCH'] == 'WINNT':
-    Classes += [
-        {
-            'cid': '{63c7b9f4-0cc8-43f8-b666-0a661655cb73}',
-            'contract_ids': shell_service_contracts,
-            'type': 'nsWindowsShellService',
-            'headers': ['/browser/components/shell/nsWindowsShellService.h'],
-        },
-        {
-            'cid': '{93480624-806e-4756-b7cb-0fb7dd746a8f}',
-            'contract_ids': ['@mozilla.org/profile/migrator/iehistoryenumerator;1'],
-            'type': 'nsIEHistoryEnumerator',
-            'headers': ['/browser/components/migration/nsIEHistoryEnumerator.h'],
-        },
-    ]
--- a/browser/components/build/moz.build
+++ b/browser/components/build/moz.build
@@ -2,18 +2,22 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files("**"):
     BUG_COMPONENT = ("Firefox Build System", "General")
 
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXPORTS += [
+    'nsBrowserCompsCID.h',
+]
+
+SOURCES += [
+    'nsModule.cpp',
 ]
 
 Library('browsercomps')
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../about',
     '../dirprovider',
--- a/browser/components/build/nsBrowserCompsCID.h
+++ b/browser/components/build/nsBrowserCompsCID.h
@@ -35,15 +35,34 @@
 // 136e2c4d-c5a4-477c-b131-d93d7d704f64
 #define NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID      \
   {                                                  \
     0x136e2c4d, 0xc5a4, 0x477c, {                    \
       0xb1, 0x31, 0xd9, 0x3d, 0x7d, 0x70, 0x4f, 0x64 \
     }                                                \
   }
 
+// 7e4bb6ad-2fc4-4dc6-89ef-23e8e5ccf980
+#define NS_BROWSER_ABOUT_REDIRECTOR_CID              \
+  {                                                  \
+    0x7e4bb6ad, 0x2fc4, 0x4dc6, {                    \
+      0x89, 0xef, 0x23, 0xe8, 0xe5, 0xcc, 0xf9, 0x80 \
+    }                                                \
+  }
+
 // {6DEB193C-F87D-4078-BC78-5E64655B4D62}
 #define NS_BROWSERDIRECTORYPROVIDER_CID              \
   {                                                  \
     0x6deb193c, 0xf87d, 0x4078, {                    \
       0xbc, 0x78, 0x5e, 0x64, 0x65, 0x5b, 0x4d, 0x62 \
     }                                                \
   }
+
+#if defined(MOZ_WIDGET_COCOA)
+#  define NS_MACATTRIBUTIONSERVICE_CONTRACTID "@mozilla.org/mac-attribution;1"
+
+#  define NS_MACATTRIBUTIONSERVICE_CID                 \
+    {                                                  \
+      0x6FC66A78, 0x6CBC, 0x4B3F, {                    \
+        0xB7, 0xBA, 0x37, 0x92, 0x89, 0xB2, 0x92, 0x76 \
+      }                                                \
+    }
+#endif
new file mode 100644
--- /dev/null
+++ b/browser/components/build/nsModule.cpp
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "mozilla/ModuleUtils.h"
+
+#include "nsBrowserCompsCID.h"
+#include "DirectoryProvider.h"
+
+#if defined(XP_WIN)
+#  include "nsWindowsShellService.h"
+#elif defined(XP_MACOSX)
+#  include "nsMacShellService.h"
+#elif defined(MOZ_WIDGET_GTK)
+#  include "nsGNOMEShellService.h"
+#endif
+#include "nsIToolkitShellService.h"
+
+#if defined(MOZ_WIDGET_COCOA)
+#  include "nsMacAttribution.h"
+#endif
+
+#if defined(XP_WIN)
+#  include "nsIEHistoryEnumerator.h"
+#endif
+
+#include "AboutRedirector.h"
+#include "nsIAboutModule.h"
+
+#include "nsNetCID.h"
+
+using namespace mozilla::browser;
+
+/////////////////////////////////////////////////////////////////////////////
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(DirectoryProvider)
+#if defined(XP_WIN)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
+#elif defined(XP_MACOSX)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
+#elif defined(MOZ_WIDGET_GTK)
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
+#endif
+
+#if defined(MOZ_WIDGET_COCOA)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacAttributionService)
+#endif
+
+#if defined(XP_WIN)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEHistoryEnumerator)
+#endif
+
+NS_DEFINE_NAMED_CID(NS_BROWSERDIRECTORYPROVIDER_CID);
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX)
+NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
+#endif
+NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
+#if defined(XP_WIN)
+NS_DEFINE_NAMED_CID(NS_WINIEHISTORYENUMERATOR_CID);
+#endif
+#if defined(MOZ_WIDGET_COCOA)
+NS_DEFINE_NAMED_CID(NS_MACATTRIBUTIONSERVICE_CID);
+#endif
+
+static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
+    // clang-format off
+    { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, nullptr, DirectoryProviderConstructor },
+#if defined(XP_WIN)
+    { &kNS_SHELLSERVICE_CID, false, nullptr, nsWindowsShellServiceConstructor },
+#elif defined(MOZ_WIDGET_GTK)
+    { &kNS_SHELLSERVICE_CID, false, nullptr, nsGNOMEShellServiceConstructor },
+#elif defined(XP_MACOSX)
+    { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor },
+#endif
+    { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create },
+#if defined(XP_WIN)
+    { &kNS_WINIEHISTORYENUMERATOR_CID, false, nullptr, nsIEHistoryEnumeratorConstructor },
+#endif
+#if defined(MOZ_WIDGET_COCOA)
+    { &kNS_MACATTRIBUTIONSERVICE_CID, false, nullptr, nsMacAttributionServiceConstructor },
+#endif
+    { nullptr }
+    // clang-format on
+};
+
+static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
+    // clang-format off
+    { NS_BROWSERDIRECTORYPROVIDER_CONTRACTID, &kNS_BROWSERDIRECTORYPROVIDER_CID },
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX)
+    { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
+    { NS_TOOLKITSHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
+#endif
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "blocked", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "certerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "config", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "tabcrashed", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "robots", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "searchreset", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "welcomeback", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "newtab", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "library", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "preferences", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "downloads", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "reader", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "restartrequired", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "welcome", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "policies", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "pocket-saved", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "pocket-signup", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "newinstall", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+#if defined(XP_WIN)
+    { NS_IEHISTORYENUMERATOR_CONTRACTID, &kNS_WINIEHISTORYENUMERATOR_CID },
+#endif
+#if defined(MOZ_WIDGET_COCOA)
+    { NS_MACATTRIBUTIONSERVICE_CONTRACTID, &kNS_MACATTRIBUTIONSERVICE_CID },
+#endif
+    { nullptr }
+    // clang-format on
+};
+
+static const mozilla::Module::CategoryEntry kBrowserCategories[] = {
+    {XPCOM_DIRECTORY_PROVIDER_CATEGORY, "browser-directory-provider",
+     NS_BROWSERDIRECTORYPROVIDER_CONTRACTID},
+    {nullptr}};
+
+static const mozilla::Module kBrowserModule = {mozilla::Module::kVersion,
+                                               kBrowserCIDs, kBrowserContracts,
+                                               kBrowserCategories};
+
+NSMODULE_DEFN(nsBrowserCompsModule) = &kBrowserModule;
deleted file mode 100644
--- a/browser/components/components.conf
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{5d0ce354-df01-421a-83fb-7ead0990c24e}',
-        'contract_ids': [
-            '@mozilla.org/browser/clh;1',
-            '@mozilla.org/uriloader/content-handler;1?type=application/http-index-format',
-            '@mozilla.org/uriloader/content-handler;1?type=application/vnd.mozilla.xul+xml',
-            '@mozilla.org/uriloader/content-handler;1?type=application/xhtml+xml',
-            '@mozilla.org/uriloader/content-handler;1?type=image/bmp',
-            '@mozilla.org/uriloader/content-handler;1?type=image/gif',
-            '@mozilla.org/uriloader/content-handler;1?type=image/jpeg',
-            '@mozilla.org/uriloader/content-handler;1?type=image/jpg',
-            '@mozilla.org/uriloader/content-handler;1?type=image/png',
-            '@mozilla.org/uriloader/content-handler;1?type=image/svg+xml',
-            '@mozilla.org/uriloader/content-handler;1?type=image/vnd.microsoft.icon',
-            '@mozilla.org/uriloader/content-handler;1?type=image/x-icon',
-            '@mozilla.org/uriloader/content-handler;1?type=text/css',
-            '@mozilla.org/uriloader/content-handler;1?type=text/html',
-            '@mozilla.org/uriloader/content-handler;1?type=text/plain',
-            '@mozilla.org/uriloader/content-handler;1?type=text/rdf',
-            '@mozilla.org/uriloader/content-handler;1?type=text/xml',
-        ],
-        'jsm': 'resource:///modules/BrowserContentHandler.jsm',
-        'constructor': 'nsBrowserContentHandler',
-        'categories': {
-            'command-line-handler': 'm-browser',
-            'command-line-validator': 'b-browser',
-        },
-    },
-    {
-        'cid': '{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}',
-        'contract_ids': ['@mozilla.org/browser/final-clh;1'],
-        'jsm': 'resource:///modules/BrowserContentHandler.jsm',
-        'constructor': 'nsDefaultCommandLineHandler',
-        'categories': {'command-line-handler': 'x-default'},
-    },
-    {
-        'cid': '{eab9012e-5f74-4cbc-b2b5-a590235513cc}',
-        'contract_ids': ['@mozilla.org/browser/browserglue;1'],
-        'jsm': 'resource:///modules/BrowserGlue.jsm',
-        'constructor': 'BrowserGlue',
-    },
-    {
-        'cid': '{d8903bf6-68d5-4e97-bcd1-e4d3012f721a}',
-        'contract_ids': ['@mozilla.org/content-permission/prompt;1'],
-        'jsm': 'resource:///modules/BrowserGlue.jsm',
-        'constructor': 'ContentPermissionPrompt',
-    },
-]
rename from browser/components/migration/360seProfileMigrator.jsm
rename to browser/components/migration/360seProfileMigrator.js
--- a/browser/components/migration/360seProfileMigrator.jsm
+++ b/browser/components/migration/360seProfileMigrator.js
@@ -316,9 +316,9 @@ Qihoo360seProfileMigrator.prototype.getL
     return new Date(Math.max.apply(Math, dates));
   });
 };
 
 Qihoo360seProfileMigrator.prototype.classDescription = "360 Secure Browser Profile Migrator";
 Qihoo360seProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=360se";
 Qihoo360seProfileMigrator.prototype.classID = Components.ID("{d0037b95-296a-4a4e-94b2-c3d075d20ab1}");
 
-var EXPORTED_SYMBOLS = ["Qihoo360seProfileMigrator"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Qihoo360seProfileMigrator]);
new file mode 100644
--- /dev/null
+++ b/browser/components/migration/BrowserProfileMigrators.manifest
@@ -0,0 +1,38 @@
+component {6F8BB968-C14F-4D6F-9733-6C6737B35DCE} ProfileMigrator.js
+contract @mozilla.org/toolkit/profile-migrator;1 {6F8BB968-C14F-4D6F-9733-6C6737B35DCE}
+
+#if defined(XP_WIN) || defined(XP_MACOSX)
+component {4bf85aa5-4e21-46ca-825f-f9c51a5e8c76} ChromeProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=canary {4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}
+#else
+component {47f75963-840b-4950-a1f0-d9c1864f8b8e} ChromeProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=chrome-beta {47f75963-840b-4950-a1f0-d9c1864f8b8e}
+component {7370a02a-4886-42c3-a4ec-d48c726ec30a} ChromeProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=chrome-dev {7370a02a-4886-42c3-a4ec-d48c726ec30a}
+#endif
+component {4cec1de4-1671-4fc3-a53e-6c539dc77a26} ChromeProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=chrome {4cec1de4-1671-4fc3-a53e-6c539dc77a26}
+component {8cece922-9720-42de-b7db-7cef88cb07ca} ChromeProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=chromium {8cece922-9720-42de-b7db-7cef88cb07ca}
+
+component {91185366-ba97-4438-acba-48deaca63386} FirefoxProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=firefox {91185366-ba97-4438-acba-48deaca63386}
+
+#ifdef HAS_IE_MIGRATOR
+component {3d2532e3-4932-4774-b7ba-968f5899d3a4} IEProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=ie {3d2532e3-4932-4774-b7ba-968f5899d3a4}
+#endif
+
+#ifdef HAS_EDGE_MIGRATOR
+component {62e8834b-2d17-49f5-96ff-56344903a2ae} EdgeProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=edge {62e8834b-2d17-49f5-96ff-56344903a2ae}
+#endif
+
+#ifdef HAS_SAFARI_MIGRATOR
+component {4b609ecf-60b2-4655-9df4-dc149e474da1} SafariProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=safari {4b609ecf-60b2-4655-9df4-dc149e474da1}
+#endif
+#ifdef HAS_360SE_MIGRATOR
+component {d0037b95-296a-4a4e-94b2-c3d075d20ab1} 360seProfileMigrator.js
+contract @mozilla.org/profile/migrator;1?app=browser&type=360se {d0037b95-296a-4a4e-94b2-c3d075d20ab1}
+#endif
rename from browser/components/migration/ChromeProfileMigrator.jsm
rename to browser/components/migration/ChromeProfileMigrator.js
--- a/browser/components/migration/ChromeProfileMigrator.jsm
+++ b/browser/components/migration/ChromeProfileMigrator.js
@@ -11,16 +11,17 @@ const AUTH_TYPE = {
   SCHEME_BASIC: 1,
   SCHEME_DIGEST: 2,
 };
 
 const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 const {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {ChromeMigrationUtils} = ChromeUtils.import("resource:///modules/ChromeMigrationUtils.jsm");
 const {MigrationUtils, MigratorPrototype} = ChromeUtils.import("resource:///modules/MigrationUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PlacesUtils",
                                "resource://gre/modules/PlacesUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "OSCrypto",
                                "resource://gre/modules/OSCrypto.jsm");
 
@@ -426,32 +427,32 @@ function ChromiumProfileMigrator() {
   this._chromeUserDataPathSuffix = "Chromium";
 }
 
 ChromiumProfileMigrator.prototype = Object.create(ChromeProfileMigrator.prototype);
 ChromiumProfileMigrator.prototype.classDescription = "Chromium Profile Migrator";
 ChromiumProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chromium";
 ChromiumProfileMigrator.prototype.classID = Components.ID("{8cece922-9720-42de-b7db-7cef88cb07ca}");
 
-var EXPORTED_SYMBOLS = ["ChromeProfileMigrator", "ChromiumProfileMigrator"];
+var componentsArray = [ChromeProfileMigrator, ChromiumProfileMigrator];
 
 /**
  * Chrome Canary
  * Not available on Linux
  **/
 function CanaryProfileMigrator() {
   this._chromeUserDataPathSuffix = "Canary";
 }
 CanaryProfileMigrator.prototype = Object.create(ChromeProfileMigrator.prototype);
 CanaryProfileMigrator.prototype.classDescription = "Chrome Canary Profile Migrator";
 CanaryProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=canary";
 CanaryProfileMigrator.prototype.classID = Components.ID("{4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}");
 
 if (AppConstants.platform == "win" || AppConstants.platform == "macosx") {
-  EXPORTED_SYMBOLS.push("CanaryProfileMigrator");
+  componentsArray.push(CanaryProfileMigrator);
 }
 
 /**
  * Chrome Dev / Unstable and Beta. Only separate from `regular` chrome on Linux
  */
 if (AppConstants.platform != "win" && AppConstants.platform != "macosx") {
   function ChromeDevMigrator() {
     this._chromeUserDataPathSuffix = "Chrome Dev";
@@ -464,10 +465,12 @@ if (AppConstants.platform != "win" && Ap
   function ChromeBetaMigrator() {
     this._chromeUserDataPathSuffix = "Chrome Beta";
   }
   ChromeBetaMigrator.prototype = Object.create(ChromeProfileMigrator.prototype);
   ChromeBetaMigrator.prototype.classDescription = "Chrome Beta Profile Migrator";
   ChromeBetaMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chrome-beta";
   ChromeBetaMigrator.prototype.classID = Components.ID("{47f75963-840b-4950-a1f0-d9c1864f8b8e}");
 
-  EXPORTED_SYMBOLS.push("ChromeDevMigrator", "ChromeBetaMigrator");
+  componentsArray.push(ChromeDevMigrator, ChromeBetaMigrator);
 }
+
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory(componentsArray);
rename from browser/components/migration/EdgeProfileMigrator.jsm
rename to browser/components/migration/EdgeProfileMigrator.js
--- a/browser/components/migration/EdgeProfileMigrator.jsm
+++ b/browser/components/migration/EdgeProfileMigrator.js
@@ -491,9 +491,9 @@ EdgeProfileMigrator.prototype.__defineGe
   return true;
 });
 
 
 EdgeProfileMigrator.prototype.classDescription = "Edge Profile Migrator";
 EdgeProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=edge";
 EdgeProfileMigrator.prototype.classID = Components.ID("{62e8834b-2d17-49f5-96ff-56344903a2ae}");
 
-var EXPORTED_SYMBOLS = ["EdgeProfileMigrator"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([EdgeProfileMigrator]);
rename from browser/components/migration/FirefoxProfileMigrator.jsm
rename to browser/components/migration/FirefoxProfileMigrator.js
--- a/browser/components/migration/FirefoxProfileMigrator.jsm
+++ b/browser/components/migration/FirefoxProfileMigrator.js
@@ -8,16 +8,17 @@
 
 /*
  * Migrates from a Firefox profile in a lossy manner in order to clean up a
  * user's profile.  Data is only migrated where the benefits outweigh the
  * potential problems caused by importing undesired/invalid configurations
  * from the source profile.
  */
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {MigrationUtils, MigratorPrototype} = ChromeUtils.import("resource:///modules/MigrationUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PlacesBackups",
                                "resource://gre/modules/PlacesBackups.jsm");
 ChromeUtils.defineModuleGetter(this, "SessionMigration",
                                "resource:///modules/sessionstore/SessionMigration.jsm");
 ChromeUtils.defineModuleGetter(this, "OS",
@@ -270,9 +271,9 @@ Object.defineProperty(FirefoxProfileMigr
   get: () => true,
 });
 
 
 FirefoxProfileMigrator.prototype.classDescription = "Firefox Profile Migrator";
 FirefoxProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=firefox";
 FirefoxProfileMigrator.prototype.classID = Components.ID("{91185366-ba97-4438-acba-48deaca63386}");
 
-var EXPORTED_SYMBOLS = ["FirefoxProfileMigrator"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]);
rename from browser/components/migration/IEProfileMigrator.jsm
rename to browser/components/migration/IEProfileMigrator.js
--- a/browser/components/migration/IEProfileMigrator.jsm
+++ b/browser/components/migration/IEProfileMigrator.js
@@ -351,9 +351,9 @@ IEProfileMigrator.prototype.getLastUsedD
     return new Date(Math.max.apply(Math, dates));
   });
 };
 
 IEProfileMigrator.prototype.classDescription = "IE Profile Migrator";
 IEProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=ie";
 IEProfileMigrator.prototype.classID = Components.ID("{3d2532e3-4932-4774-b7ba-968f5899d3a4}");
 
-var EXPORTED_SYMBOLS = ["IEProfileMigrator"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]);
rename from browser/components/migration/ProfileMigrator.jsm
rename to browser/components/migration/ProfileMigrator.js
--- a/browser/components/migration/ProfileMigrator.jsm
+++ b/browser/components/migration/ProfileMigrator.js
@@ -1,20 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {MigrationUtils} = ChromeUtils.import("resource:///modules/MigrationUtils.jsm");
 
 function ProfileMigrator() {
 }
 
 ProfileMigrator.prototype = {
   migrate: MigrationUtils.startupMigration.bind(MigrationUtils),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIProfileMigrator]),
   classDescription: "Profile Migrator",
   contractID: "@mozilla.org/toolkit/profile-migrator;1",
   classID: Components.ID("6F8BB968-C14F-4D6F-9733-6C6737B35DCE"),
 };
 
-var EXPORTED_SYMBOLS = ["ProfileMigrator"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]);
rename from browser/components/migration/SafariProfileMigrator.jsm
rename to browser/components/migration/SafariProfileMigrator.js
--- a/browser/components/migration/SafariProfileMigrator.jsm
+++ b/browser/components/migration/SafariProfileMigrator.js
@@ -377,9 +377,9 @@ Object.defineProperty(SafariProfileMigra
     return this._mainPreferencesPropertyList;
   },
 });
 
 SafariProfileMigrator.prototype.classDescription = "Safari Profile Migrator";
 SafariProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=safari";
 SafariProfileMigrator.prototype.classID = Components.ID("{4b609ecf-60b2-4655-9df4-dc149e474da1}");
 
-var EXPORTED_SYMBOLS = ["SafariProfileMigrator"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]);
deleted file mode 100644
--- a/browser/components/migration/components.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XP_WIN = buildconfig.substs['OS_ARCH'] == 'WINNT'
-XP_MACOSX = buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'cocoa'
-
-Classes = [
-    {
-        'cid': '{6F8BB968-C14F-4D6F-9733-6C6737B35DCE}',
-        'contract_ids': ['@mozilla.org/toolkit/profile-migrator;1'],
-        'jsm': 'resource:///modules/ProfileMigrator.jsm',
-        'constructor': 'ProfileMigrator',
-    },
-    {
-        'cid': '{4cec1de4-1671-4fc3-a53e-6c539dc77a26}',
-        'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome'],
-        'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
-        'constructor': 'ChromeProfileMigrator',
-    },
-    {
-        'cid': '{8cece922-9720-42de-b7db-7cef88cb07ca}',
-        'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chromium'],
-        'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
-        'constructor': 'ChromiumProfileMigrator',
-    },
-    {
-        'cid': '{91185366-ba97-4438-acba-48deaca63386}',
-        'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=firefox'],
-        'jsm': 'resource:///modules/FirefoxProfileMigrator.jsm',
-        'constructor': 'FirefoxProfileMigrator',
-    },
-]
-
-if XP_WIN or XP_MACOSX:
-    Classes += [
-        {
-            'cid': '{4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}',
-            'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=canary'],
-            'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
-            'constructor': 'CanaryProfileMigrator',
-        },
-    ]
-else:
-    Classes += [
-        {
-            'cid': '{47f75963-840b-4950-a1f0-d9c1864f8b8e}',
-            'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome-beta'],
-            'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
-            'constructor': '  ChromeBetaMigrator',
-        },
-        {
-            'cid': '{7370a02a-4886-42c3-a4ec-d48c726ec30a}',
-            'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome-dev'],
-            'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
-            'constructor': '  ChromeDevMigrator',
-        },
-    ]
-
-if XP_WIN:
-    Classes += [
-        {
-            'cid': '{3d2532e3-4932-4774-b7ba-968f5899d3a4}',
-            'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=ie'],
-            'jsm': 'resource:///modules/IEProfileMigrator.jsm',
-            'constructor': 'IEProfileMigrator',
-        },
-        {
-            'cid': '{62e8834b-2d17-49f5-96ff-56344903a2ae}',
-            'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=edge'],
-            'jsm': 'resource:///modules/EdgeProfileMigrator.jsm',
-            'constructor': 'EdgeProfileMigrator',
-        },
-        {
-            'cid': '{d0037b95-296a-4a4e-94b2-c3d075d20ab1}',
-            'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=360se'],
-            'jsm': 'resource:///modules/360seProfileMigrator.jsm',
-            'constructor': 'Qihoo360seProfileMigrator',
-        },
-    ]
-
-if XP_MACOSX:
-    Classes += [
-        {
-            'cid': '{4b609ecf-60b2-4655-9df4-dc149e474da1}',
-            'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=safari'],
-            'jsm': 'resource:///modules/SafariProfileMigrator.jsm',
-            'constructor': 'SafariProfileMigrator',
-        },
-    ]
--- a/browser/components/migration/moz.build
+++ b/browser/components/migration/moz.build
@@ -11,41 +11,50 @@ MARIONETTE_UNIT_MANIFESTS += ['tests/mar
 JAR_MANIFESTS += ['jar.mn']
 
 XPIDL_SOURCES += [
     'nsIBrowserProfileMigrator.idl',
 ]
 
 XPIDL_MODULE = 'migration'
 
+EXTRA_COMPONENTS += [
+    'ChromeProfileMigrator.js',
+    'FirefoxProfileMigrator.js',
+    'ProfileMigrator.js',
+]
+
+EXTRA_PP_COMPONENTS += [
+    'BrowserProfileMigrators.manifest',
+]
+
 EXTRA_JS_MODULES += [
     'ChromeMigrationUtils.jsm',
-    'ChromeProfileMigrator.jsm',
-    'FirefoxProfileMigrator.jsm',
     'MigrationUtils.jsm',
-    'ProfileMigrator.jsm',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'nsIEHistoryEnumerator.cpp',
     ]
+    EXTRA_COMPONENTS += [
+        '360seProfileMigrator.js',
+        'EdgeProfileMigrator.js',
+        'IEProfileMigrator.js',
+    ]
     EXTRA_JS_MODULES += [
-        '360seProfileMigrator.jsm',
-        'EdgeProfileMigrator.jsm',
         'ESEDBReader.jsm',
-        'IEProfileMigrator.jsm',
         'MSMigrationUtils.jsm',
     ]
+    DEFINES['HAS_360SE_MIGRATOR'] = True
+    DEFINES['HAS_IE_MIGRATOR'] = True
+    DEFINES['HAS_EDGE_MIGRATOR'] = True
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
-    EXTRA_JS_MODULES += [
-        'SafariProfileMigrator.jsm',
+    EXTRA_COMPONENTS += [
+        'SafariProfileMigrator.js',
     ]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
+    DEFINES['HAS_SAFARI_MIGRATOR'] = True
 
 FINAL_LIBRARY = 'browsercomps'
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'Migration')
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -69,29 +69,25 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
     DIRS += ['touchbar']
 
 XPIDL_SOURCES += [
     'nsIBrowserHandler.idl',
 ]
 
 XPIDL_MODULE = 'browsercompsbase'
 
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
 EXTRA_COMPONENTS += [
     'BrowserComponents.manifest',
+    'nsBrowserContentHandler.js',
+    'nsBrowserGlue.js',
     'tests/startupRecorder.js',
     'tests/testComponents.manifest',
 ]
 
 EXTRA_JS_MODULES += [
-    'BrowserContentHandler.jsm',
-    'BrowserGlue.jsm',
     'distribution.js',
 ]
 
 BROWSER_CHROME_MANIFESTS += [
     'safebrowsing/content/test/browser.ini',
     'tests/browser/browser.ini'
 ]
 
new file mode 100644
--- /dev/null
+++ b/browser/components/newtab/NewTabComponents.manifest
@@ -0,0 +1,2 @@
+component {dfcd2adc-7867-4d3a-ba70-17501f208142} aboutNewTabService.js
+contract @mozilla.org/browser/aboutnewtab-service;1 {dfcd2adc-7867-4d3a-ba70-17501f208142}
rename from browser/components/newtab/AboutNewTabService.jsm
rename to browser/components/newtab/aboutNewTabService.js
--- a/browser/components/newtab/AboutNewTabService.jsm
+++ b/browser/components/newtab/aboutNewTabService.js
@@ -356,9 +356,9 @@ AboutNewTabService.prototype = {
     Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED, this);
     if (!IS_RELEASE_OR_BETA) {
       Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_DEBUG, this);
     }
     this.initialized = false;
   },
 };
 
-var EXPORTED_SYMBOLS = ["AboutNewTabService"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutNewTabService]);
deleted file mode 100644
--- a/browser/components/newtab/components.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{dfcd2adc-7867-4d3a-ba70-17501f208142}',
-        'contract_ids': ['@mozilla.org/browser/aboutnewtab-service;1'],
-        'jsm': 'resource:///modules/AboutNewTabService.jsm',
-        'constructor': 'AboutNewTabService',
-    },
-]
--- a/browser/components/newtab/moz.build
+++ b/browser/components/newtab/moz.build
@@ -14,17 +14,14 @@ XPCSHELL_TESTS_MANIFESTS += [
 ]
 
 XPIDL_SOURCES += [
     'nsIAboutNewTabService.idl',
 ]
 
 XPIDL_MODULE = 'browser-newtab'
 
-EXTRA_JS_MODULES += [
-    'AboutNewTabService.jsm',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_COMPONENTS += [
+    'aboutNewTabService.js',
+    'NewTabComponents.manifest',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
rename from browser/components/BrowserContentHandler.jsm
rename to browser/components/nsBrowserContentHandler.js
--- a/browser/components/BrowserContentHandler.jsm
+++ b/browser/components/nsBrowserContentHandler.js
@@ -1,14 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var EXPORTED_SYMBOLS = ["nsBrowserContentHandler", "nsDefaultCommandLineHandler"];
-
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
   HeadlessShell: "resource:///modules/HeadlessShell.jsm",
   HomePage: "resource:///modules/HomePage.jsm",
@@ -175,17 +173,17 @@ function getPostUpdateOverridePage(defau
     return defaultOverridePage;
   }
 
   return update.getProperty("openURL") || defaultOverridePage;
 }
 
 /**
  * Open a browser window. If this is the initial launch, this function will
- * attempt to use the navigator:blank window opened by BrowserGlue.jsm during
+ * attempt to use the navigator:blank window opened by nsBrowserGlue.js during
  * early startup.
  *
  * @param cmdLine
  *        The nsICommandLine object given to nsICommandLineHandler's handle
  *        method.
  *        Used to check if we are processing the command line for the initial launch.
  * @param triggeringPrincipal
  *        The nsIPrincipal to use as triggering principal for the page load(s).
@@ -322,22 +320,28 @@ function doSearch(searchTerm, cmdLine) {
   var submission = engine.getSubmission(searchTerm, null, "system");
 
   // XXXbsmedberg: use handURIToExistingBrowser to obey tabbed-browsing
   // preferences, but need nsIBrowserDOMWindow extensions
   openBrowserWindow(cmdLine, gSystemPrincipal, submission.uri.spec, submission.postData);
 }
 
 function nsBrowserContentHandler() {
-  if (!gBrowserContentHandler) {
-    gBrowserContentHandler = this;
-  }
-  return gBrowserContentHandler;
 }
 nsBrowserContentHandler.prototype = {
+  classID: Components.ID("{5d0ce354-df01-421a-83fb-7ead0990c24e}"),
+
+  _xpcom_factory: {
+    createInstance: function bch_factory_ci(outer, iid) {
+      if (outer)
+        throw Cr.NS_ERROR_NO_AGGREGATION;
+      return gBrowserContentHandler.QueryInterface(iid);
+    },
+  },
+
   /* nsISupports */
   QueryInterface: ChromeUtils.generateQI([Ci.nsICommandLineHandler,
                                           Ci.nsIBrowserHandler,
                                           Ci.nsIContentHandler,
                                           Ci.nsICommandLineValidator]),
 
   /* nsICommandLineHandler */
   handle: function bch_handle(cmdLine) {
@@ -724,16 +728,18 @@ function handURIToExistingBrowser(uri, l
   bwin.openURI(uri, null, location,
                Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL, triggeringPrincipal);
 }
 
 function nsDefaultCommandLineHandler() {
 }
 
 nsDefaultCommandLineHandler.prototype = {
+  classID: Components.ID("{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}"),
+
   /* nsISupports */
   QueryInterface: ChromeUtils.generateQI(["nsICommandLineHandler"]),
 
   _haveProfile: false,
 
   /* nsICommandLineHandler */
   handle: function dch_handle(cmdLine) {
     var urilist = [];
@@ -825,8 +831,11 @@ nsDefaultCommandLineHandler.prototype = 
       let win = Services.wm.getMostRecentWindow("navigator:blank");
       if (win)
         win.close();
     }
   },
 
   helpInfo: "",
 };
+
+var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
rename from browser/components/BrowserGlue.jsm
rename to browser/components/nsBrowserGlue.js
--- a/browser/components/BrowserGlue.jsm
+++ b/browser/components/nsBrowserGlue.js
@@ -1,14 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var EXPORTED_SYMBOLS = ["BrowserGlue", "ContentPermissionPrompt"];
-
 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 ChromeUtils.defineModuleGetter(this, "ActorManagerParent",
                                "resource://gre/modules/ActorManagerParent.jsm");
@@ -362,89 +360,90 @@ let ACTORS = {
   // The window becomes visible after OnStopRequest, so make this happen now.
   win.stop();
 
   let { TelemetryTimestamps } =
     ChromeUtils.import("resource://gre/modules/TelemetryTimestamps.jsm");
   TelemetryTimestamps.add("blankWindowShown");
 })();
 
+XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
+
 XPCOMUtils.defineLazyServiceGetters(this, {
+  WindowsUIUtils: ["@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils"],
   aboutNewTabService: ["@mozilla.org/browser/aboutnewtab-service;1", "nsIAboutNewTabService"],
 });
 XPCOMUtils.defineLazyGetter(this, "WeaveService", () =>
   Cc["@mozilla.org/weave/service;1"].getService().wrappedJSObject
 );
 
 // lazy module getters
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AboutPrivateBrowsingHandler: "resource:///modules/aboutpages/AboutPrivateBrowsingHandler.jsm",
   AddonManager: "resource://gre/modules/AddonManager.jsm",
   AppMenuNotifications: "resource://gre/modules/AppMenuNotifications.jsm",
+  AsyncPrefs: "resource://gre/modules/AsyncPrefs.jsm",
   AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
   AutoCompletePopup: "resource://gre/modules/AutoCompletePopup.jsm",
   Blocklist: "resource://gre/modules/Blocklist.jsm",
   BookmarkHTMLUtils: "resource://gre/modules/BookmarkHTMLUtils.jsm",
   BookmarkJSONUtils: "resource://gre/modules/BookmarkJSONUtils.jsm",
   BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
   BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
+  ContentClick: "resource:///modules/ContentClick.jsm",
   ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
+  CustomizableUI: "resource:///modules/CustomizableUI.jsm",
   DateTimePickerParent: "resource://gre/modules/DateTimePickerParent.jsm",
   Discovery: "resource:///modules/Discovery.jsm",
   ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
   FileSource: "resource://gre/modules/L10nRegistry.jsm",
+  FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
   FxAccounts: "resource://gre/modules/FxAccounts.jsm",
   HomePage: "resource:///modules/HomePage.jsm",
   HybridContentTelemetry: "resource://gre/modules/HybridContentTelemetry.jsm",
   Integration: "resource://gre/modules/Integration.jsm",
   L10nRegistry: "resource://gre/modules/L10nRegistry.jsm",
   LanguagePrompt: "resource://gre/modules/LanguagePrompt.jsm",
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
   LiveBookmarkMigrator: "resource:///modules/LiveBookmarkMigrator.jsm",
+  LoginHelper: "resource://gre/modules/LoginHelper.jsm",
+  LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
   NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
   Normandy: "resource://normandy/Normandy.jsm",
   ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
   OS: "resource://gre/modules/osfile.jsm",
   PageActions: "resource:///modules/PageActions.jsm",
   PageThumbs: "resource://gre/modules/PageThumbs.jsm",
   PdfJs: "resource://pdf.js/PdfJs.jsm",
   PermissionUI: "resource:///modules/PermissionUI.jsm",
+  PictureInPicture: "resource://gre/modules/PictureInPicture.jsm",
   PingCentre: "resource:///modules/PingCentre.jsm",
   PlacesBackups: "resource://gre/modules/PlacesBackups.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   PluralForm: "resource://gre/modules/PluralForm.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
   ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
+  ReaderParent: "resource:///modules/ReaderParent.jsm",
+  RemotePrompt: "resource:///modules/RemotePrompt.jsm",
   RemoteSettings: "resource://services-settings/remote-settings.js",
   SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
   Sanitizer: "resource:///modules/Sanitizer.jsm",
   SaveToPocket: "chrome://pocket/content/SaveToPocket.jsm",
   SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
   SessionStartup: "resource:///modules/sessionstore/SessionStartup.jsm",
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   ShellService: "resource:///modules/ShellService.jsm",
   TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
   UIState: "resource://services-sync/UIState.jsm",
   UITour: "resource:///modules/UITour.jsm",
   WebChannel: "resource://gre/modules/WebChannel.jsm",
   WindowsRegistry: "resource://gre/modules/WindowsRegistry.jsm",
 });
 
-// eslint-disable-next-line no-unused-vars
-XPCOMUtils.defineLazyModuleGetters(this, {
-  AsyncPrefs: "resource://gre/modules/AsyncPrefs.jsm",
-  ContentClick: "resource:///modules/ContentClick.jsm",
-  FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
-  LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
-  PictureInPicture: "resource://gre/modules/PictureInPicture.jsm",
-  ReaderParent: "resource:///modules/ReaderParent.jsm",
-  RemotePrompt: "resource:///modules/RemotePrompt.jsm",
-});
-
 /* global ContentPrefServiceParent:false, ContentSearch:false,
           UpdateListener:false, webrtcUI:false */
 
 /**
  * IF YOU ADD OR REMOVE FROM THIS LIST, PLEASE UPDATE THE LIST ABOVE AS WELL.
  * XXX Bug 1325373 is for making eslint detect these automatically.
  */
 
@@ -462,16 +461,17 @@ let initializedModules = {};
     return initializedModules[name];
   });
 });
 
 if (AppConstants.MOZ_CRASHREPORTER) {
   XPCOMUtils.defineLazyModuleGetters(this, {
     PluginCrashReporter: "resource:///modules/ContentCrashHandlers.jsm",
     UnsubmittedCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
+    CrashSubmit: "resource://gre/modules/CrashSubmit.jsm",
   });
 }
 
 XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
   return Services.strings.createBundle("chrome://branding/locale/brand.properties");
 });
 
 XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
@@ -2980,18 +2980,23 @@ BrowserGlue.prototype = {
     if (state.status == UIState.STATUS_LOGIN_FAILED ||
         state.status == UIState.STATUS_NOT_VERIFIED) {
       AppMenuNotifications.showBadgeOnlyNotification("fxa-needs-authentication");
     } else {
       AppMenuNotifications.removeNotification("fxa-needs-authentication");
     }
   },
 
+  // for XPCOM
+  classID:          Components.ID("{eab9012e-5f74-4cbc-b2b5-a590235513cc}"),
+
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
+
+  _xpcom_factory: XPCOMUtils.generateSingletonFactory(BrowserGlue),
 };
 
 var ContentBlockingCategoriesPrefs = {
   PREF_CB_CATEGORY: "browser.contentblocking.category",
   // The prefs inside CATEGORY_PREFS set expected value for each CB category.
   // A null value means that pref is default.
   CATEGORY_PREFS: {
     strict: [
@@ -3479,16 +3484,19 @@ var JawsScreenReaderVersionCheck = {
 
     notification =
       win.PopupNotifications.show(browser, "e10s_enabled_with_incompat_jaws",
                                   promptMessage, null, mainAction,
                                   null, options);
   },
 };
 
+var components = [BrowserGlue, ContentPermissionPrompt];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
+
 // Listen for UITour messages.
 // Do it here instead of the UITour module itself so that the UITour module is lazy loaded
 // when the first message is received.
 Services.mm.addMessageListener("UITour:onPageEvent", function(aMessage) {
   UITour.onPageEvent(aMessage, aMessage.data);
 });
 
 // Listen for HybridContentTelemetry messages.
deleted file mode 100644
--- a/browser/components/payments/components.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{01f8bd55-9017-438b-85ec-7c15d2b35cdc}',
-        'contract_ids': ['@mozilla.org/dom/payments/payment-ui-service;1'],
-        'jsm': 'resource:///modules/PaymentUIService.jsm',
-        'constructor': 'PaymentUIService',
-    },
-]
--- a/browser/components/payments/moz.build
+++ b/browser/components/payments/moz.build
@@ -4,22 +4,19 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'WebPayments UI')
 
-EXTRA_JS_MODULES += [
-    'PaymentUIService.jsm',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_COMPONENTS += [
+    'payments.manifest',
+    'paymentUIService.js',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
 
 MOCHITEST_MANIFESTS += [
     'test/mochitest/formautofill/mochitest.ini',
     'test/mochitest/mochitest.ini',
 ]
rename from browser/components/payments/PaymentUIService.jsm
rename to browser/components/payments/paymentUIService.js
--- a/browser/components/payments/PaymentUIService.jsm
+++ b/browser/components/payments/paymentUIService.js
@@ -296,9 +296,9 @@ PaymentUIService.prototype = {
       case "SwapDocShells": {
         this._moveDialogToNewBrowser(event.target, event.detail);
         break;
       }
     }
   },
 };
 
-var EXPORTED_SYMBOLS = ["PaymentUIService"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUIService]);
new file mode 100644
--- /dev/null
+++ b/browser/components/payments/payments.manifest
@@ -0,0 +1,2 @@
+component {01f8bd55-9017-438b-85ec-7c15d2b35cdc} paymentUIService.js
+contract @mozilla.org/dom/payments/payment-ui-service;1 {01f8bd55-9017-438b-85ec-7c15d2b35cdc}
--- a/browser/components/preferences/in-content/tests/browser_advanced_update.js
+++ b/browser/components/preferences/in-content/tests/browser_advanced_update.js
@@ -9,37 +9,41 @@ const uuidGenerator = Cc["@mozilla.org/u
 
 const mockUpdateManager = {
   contractId: "@mozilla.org/updates/update-manager;1",
 
   _mockClassId: uuidGenerator.generateUUID(),
 
   _originalClassId: "",
 
+  _originalFactory: null,
+
   QueryInterface: ChromeUtils.generateQI([Ci.nsIUpdateManager]),
 
   createInstance(outer, iiD) {
     if (outer) {
       throw Cr.NS_ERROR_NO_AGGREGATION;
     }
     return this.QueryInterface(iiD);
   },
 
   register() {
     let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
     if (!registrar.isCIDRegistered(this._mockClassId)) {
       this._originalClassId = registrar.contractIDToCID(this.contractId);
+      this._originalFactory = Cm.getClassObject(Cc[this.contractId], Ci.nsIFactory);
+      registrar.unregisterFactory(this._originalClassId, this._originalFactory);
       registrar.registerFactory(this._mockClassId, "Unregister after testing", this.contractId, this);
     }
   },
 
   unregister() {
     let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
     registrar.unregisterFactory(this._mockClassId, this);
-    registrar.registerFactory(this._originalClassId, "", this.contractId, null);
+    registrar.registerFactory(this._originalClassId, "", this.contractId, this._originalFactory);
   },
 
   get updateCount() {
     return this._updates.length;
   },
 
   getUpdateAt(index) {
     return this._updates[index];
rename from browser/components/protocolhandler/WebProtocolHandlerRegistrar.jsm
rename to browser/components/protocolhandler/WebProtocolHandlerRegistrar.js
--- a/browser/components/protocolhandler/WebProtocolHandlerRegistrar.jsm
+++ b/browser/components/protocolhandler/WebProtocolHandlerRegistrar.js
@@ -1,16 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var EXPORTED_SYMBOLS = ["WebProtocolHandlerRegistrar"];
-
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const STRING_BUNDLE_URI = "chrome://browser/locale/feeds/subscribe.properties";
 
 function WebProtocolHandlerRegistrar() {
 }
 
 WebProtocolHandlerRegistrar.prototype = {
   get stringBundle() {
@@ -142,13 +141,18 @@ WebProtocolHandlerRegistrar.prototype = 
     let notificationBox = browser.getTabBrowser().getNotificationBox(browser);
     notificationBox.appendNotification(message,
                                        notificationValue,
                                        notificationIcon,
                                        notificationBox.PRIORITY_INFO_LOW,
                                        [addButton]);
   },
 
+  classID: Components.ID("{efbd7b87-9b15-4684-abf0-dc2679daadb1}"),
+
   /**
    * See nsISupports
    */
   QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProtocolHandlerRegistrar]),
 };
+
+this.NSGetFactory =
+  XPCOMUtils.generateNSGetFactory([WebProtocolHandlerRegistrar]);
deleted file mode 100644
--- a/browser/components/protocolhandler/components.conf
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{efbd7b87-9b15-4684-abf0-dc2679daadb1}',
-        'contract_ids': ['@mozilla.org/embeddor.implemented/web-protocol-handler-registrar;1'],
-        'jsm': 'resource:///modules/WebProtocolHandlerRegistrar.jsm',
-        'constructor': 'WebProtocolHandlerRegistrar',
-        'processes': ProcessSelector.MAIN_PROCESS_ONLY,
-    },
-]
--- a/browser/components/protocolhandler/moz.build
+++ b/browser/components/protocolhandler/moz.build
@@ -2,18 +2,14 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
 
-EXTRA_JS_MODULES += [
-    'WebProtocolHandlerRegistrar.jsm',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_COMPONENTS += [
+    'WebProtocolHandlerRegistrar.js',
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'General')
--- a/browser/components/shell/nsWindowsShellService.cpp
+++ b/browser/components/shell/nsWindowsShellService.cpp
@@ -16,16 +16,17 @@
 #include "nsIPrefLocalizedString.h"
 #include "nsIServiceManager.h"
 #include "nsIStringBundle.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsShellService.h"
 #include "nsIProcess.h"
 #include "nsICategoryManager.h"
+#include "nsBrowserCompsCID.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIWindowsRegKey.h"
 #include "nsUnicharUtils.h"
 #include "nsIURLFormatter.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/WindowsVersion.h"
--- a/browser/components/tests/browser/browser_bug538331.js
+++ b/browser/components/tests/browser/browser_bug538331.js
@@ -260,17 +260,17 @@ function testDefaultArgs() {
     if (Services.prefs.prefHasUserValue(PREF_POSTUPDATE)) {
       Services.prefs.clearUserPref(PREF_POSTUPDATE);
     }
   }
 
   testShowNotification();
 }
 
-// BrowserGlue.jsm _showUpdateNotification notification tests
+// nsBrowserGlue.js _showUpdateNotification notification tests
 const BG_NOTIFY_TESTS = [
   {
     description: "'silent showNotification' actions should not display a notification",
     actions: "silent showNotification",
   }, {
     description: "'showNotification' for actions should display a notification",
     actions: "showNotification",
   }, {
@@ -287,17 +287,17 @@ const BG_NOTIFY_TESTS = [
     notificationText: "notification text",
     notificationURL: DEFAULT_UPDATE_URL,
     notificationButtonLabel: "button label",
     notificationButtonAccessKey: "b",
   },
 ];
 
 // Test showing a notification after an update
-// _showUpdateNotification in BrowserGlue.jsm
+// _showUpdateNotification in nsBrowserGlue.js
 function testShowNotification() {
   // Catches any windows opened by these tests (e.g. alert windows) and closes
   // them
   gWindowCatcher.start();
 
   for (let i = 0; i < BG_NOTIFY_TESTS.length; i++) {
     let testCase = BG_NOTIFY_TESTS[i];
     ok(true, "Test showNotification " + (i + 1) + ": " + testCase.description);
--- a/browser/components/tests/startupRecorder.js
+++ b/browser/components/tests/startupRecorder.js
@@ -74,17 +74,17 @@ startupRecorder.prototype = {
       }),
     };
   },
 
   observe(subject, topic, data) {
     if (topic == "app-startup") {
       // We can't ensure our observer will be called first or last, so the list of
       // topics we observe here should avoid the topics used to trigger things
-      // during startup (eg. the topics observed by BrowserGlue.jsm).
+      // during startup (eg. the topics observed by nsBrowserGlue.js).
       let topics = [
         "profile-do-change", // This catches stuff loaded during app-startup
         "toplevel-window-ready", // Catches stuff from final-ui-startup
         "image-loading",
         "image-drawing",
         firstPaintNotification,
         "sessionstore-windows-restored",
       ];
deleted file mode 100644
--- a/browser/extensions/pdfjs/components.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{d0c5195d-e798-49d4-b1d3-9324328b2291}',
-        'contract_ids': [
-            '@mozilla.org/streamconv;1?from=application/pdf&to=*/*',
-            '@mozilla.org/streamconv;1?from=application/pdf&to=text/html',
-        ],
-        'jsm': 'resource:///modules/pdfjs.js',
-        'constructor': 'StreamConverterFactory',
-    },
-]
--- a/browser/extensions/pdfjs/content/PdfJs.jsm
+++ b/browser/extensions/pdfjs/content/PdfJs.jsm
@@ -104,17 +104,17 @@ var PdfJs = {
     PdfjsChromeUtils.init();
     this.initPrefs();
 
     Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
   },
 
   earlyInit() {
     // Note: Please keep this in sync with the duplicated logic in
-    // BrowserGlue.jsm.
+    // nsBrowserGlue.js.
     Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
   },
 
   initPrefs: function initPrefs() {
     if (this._initialized) {
       return;
     }
     this._initialized = true;
--- a/browser/extensions/pdfjs/moz.build
+++ b/browser/extensions/pdfjs/moz.build
@@ -6,15 +6,12 @@
 
 with Files("**"):
     BUG_COMPONENT = ("Firefox", "PDF Viewer")
 
 BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
 
 JAR_MANIFESTS += ['jar.mn']
 
-EXTRA_JS_MODULES += [
+EXTRA_COMPONENTS += [
     'pdfjs.js',
+    'pdfjs.manifest',
 ]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
--- a/browser/extensions/pdfjs/pdfjs.js
+++ b/browser/extensions/pdfjs/pdfjs.js
@@ -11,21 +11,27 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 "use strict";
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PdfStreamConverter",
   "resource://pdf.js/PdfStreamConverter.jsm");
 
 // Register/unregister a constructor as a factory.
 function StreamConverterFactory() {
   if (Services.cpmm.sharedData.get("pdfjs.enabled")) {
     return new PdfStreamConverter();
   }
   throw Cr.NS_ERROR_FACTORY_NOT_REGISTERED;
 }
+StreamConverterFactory.prototype = {
+  // properties required for XPCOM registration:
+  classID: Components.ID("{d0c5195d-e798-49d4-b1d3-9324328b2291}"),
+  classDescription: "pdf.js Component",
+};
 
-var EXPORTED_SYMBOLS = ["StreamConverterFactory"];
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([StreamConverterFactory]);
new file mode 100644
--- /dev/null
+++ b/browser/extensions/pdfjs/pdfjs.manifest
@@ -0,0 +1,3 @@
+component {d0c5195d-e798-49d4-b1d3-9324328b2291} pdfjs.js
+contract @mozilla.org/streamconv;1?from=application/pdf&to=*/* {d0c5195d-e798-49d4-b1d3-9324328b2291}
+contract @mozilla.org/streamconv;1?from=application/pdf&to=text/html {d0c5195d-e798-49d4-b1d3-9324328b2291}
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -155,71 +155,235 @@
 @BINPATH@/Accessible.tlb
 @BINPATH@/AccessibleHandler.dll
 @BINPATH@/AccessibleMarshal.dll
 @BINPATH@/IA2Marshal.dll
 #endif
 #endif
 
 ; JavaScript components
+@RESPATH@/components/ConsoleAPI.manifest
+@RESPATH@/components/ConsoleAPIStorage.js
+@RESPATH@/components/BrowserElementParent.manifest
+@RESPATH@/components/BrowserElementParent.js
+@RESPATH@/components/UAOverridesBootstrapper.js
+@RESPATH@/components/UAOverridesBootstrapper.manifest
+@RESPATH@/components/WellKnownOpportunisticUtils.js
+@RESPATH@/components/WellKnownOpportunisticUtils.manifest
+#ifndef XP_MACOSX
+; OSX uses native platform impl.  Windows, Linux, and Android uses fallback JS impl.
+@BINPATH@/components/nsDNSServiceDiscovery.manifest
+@BINPATH@/components/nsDNSServiceDiscovery.js
+#endif
 @RESPATH@/browser/components/BrowserComponents.manifest
+@RESPATH@/browser/components/nsBrowserContentHandler.js
+@RESPATH@/browser/components/nsBrowserGlue.js
+@RESPATH@/browser/components/devtools-startup.manifest
+@RESPATH@/browser/components/devtools-startup.js
+@RESPATH@/browser/components/aboutdebugging-registration.js
+@RESPATH@/browser/components/aboutdebugging.manifest
+#ifdef NIGHTLY_BUILD
+@RESPATH@/browser/components/aboutdebugging-new-registration.js
+@RESPATH@/browser/components/aboutdebugging-new.manifest
+#endif
+@RESPATH@/browser/components/aboutdevtools-registration.js
+@RESPATH@/browser/components/aboutdevtools.manifest
+@RESPATH@/browser/components/aboutdevtoolstoolbox-registration.js
+@RESPATH@/browser/components/aboutdevtoolstoolbox.manifest
+@RESPATH@/browser/components/aboutNewTabService.js
+@RESPATH@/browser/components/NewTabComponents.manifest
 @RESPATH@/browser/components/EnterprisePolicies.js
 @RESPATH@/browser/components/EnterprisePoliciesContent.js
 @RESPATH@/browser/components/EnterprisePolicies.manifest
+@RESPATH@/browser/components/WebProtocolHandlerRegistrar.js
+@RESPATH@/components/Downloads.manifest
+@RESPATH@/components/DownloadLegacy.js
+@RESPATH@/components/PageThumbsComponents.manifest
+@RESPATH@/components/crashmonitor.manifest
+@RESPATH@/components/nsCrashMonitor.js
 @RESPATH@/components/toolkitsearch.manifest
+@RESPATH@/components/nsSearchService.js
+@RESPATH@/components/nsSearchSuggestions.js
+@RESPATH@/components/nsSidebar.js
+#ifdef NIGHTLY_BUILD
+@RESPATH@/browser/components/payments.manifest
+@RESPATH@/browser/components/paymentUIService.js
+#endif
+@RESPATH@/components/passwordmgr.manifest
+@RESPATH@/components/nsLoginInfo.js
+@RESPATH@/components/nsLoginManager.js
+@RESPATH@/components/nsLoginManagerPrompter.js
+@RESPATH@/components/storage-json.js
+@RESPATH@/components/crypto-SDR.js
+@RESPATH@/components/TooltipTextProvider.js
+@RESPATH@/components/TooltipTextProvider.manifest
 @RESPATH@/components/WebVTT.manifest
 @RESPATH@/components/WebVTTParserWrapper.js
+@RESPATH@/components/nsHelperAppDlg.manifest
+@RESPATH@/components/nsHelperAppDlg.js
+@RESPATH@/components/NetworkGeolocationProvider.manifest
+@RESPATH@/components/NetworkGeolocationProvider.js
 @RESPATH@/components/extensions.manifest
+@RESPATH@/components/addonManager.js
+@RESPATH@/components/amContentHandler.js
+@RESPATH@/components/amInstallTrigger.js
+@RESPATH@/components/amWebAPI.js
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
+@RESPATH@/components/nsUpdateService.js
+@RESPATH@/components/nsUpdateServiceStub.js
 #endif
+@RESPATH@/components/nsUpdateTimerManager.manifest
+@RESPATH@/components/nsUpdateTimerManager.js
+@RESPATH@/components/utils.manifest
+@RESPATH@/components/simpleServices.js
 @RESPATH@/components/ProcessSingleton.manifest
+@RESPATH@/components/MainProcessSingleton.js
+@RESPATH@/components/ContentProcessSingleton.js
+@RESPATH@/components/nsURLFormatter.manifest
+@RESPATH@/components/nsURLFormatter.js
+@RESPATH@/components/toolkitplaces.manifest
+@RESPATH@/components/nsTaggingService.js
+@RESPATH@/components/UnifiedComplete.js
+@RESPATH@/components/nsPlacesExpiration.js
+@RESPATH@/components/PageIconProtocolHandler.js
+@RESPATH@/components/PlacesCategoriesStarter.js
+@RESPATH@/components/ColorAnalyzer.js
+@RESPATH@/components/PageThumbsStorageService.js
+@RESPATH@/components/mozProtocolHandler.js
+@RESPATH@/components/mozProtocolHandler.manifest
+@RESPATH@/components/nsDefaultCLH.manifest
+@RESPATH@/components/nsDefaultCLH.js
+@RESPATH@/components/ContentPrefService2.manifest
+@RESPATH@/components/ContentPrefService2.js
+@RESPATH@/components/nsContentDispatchChooser.manifest
+@RESPATH@/components/nsContentDispatchChooser.js
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
+@RESPATH@/components/nsWebHandlerApp.manifest
+@RESPATH@/components/nsWebHandlerApp.js
+@RESPATH@/components/satchel.manifest
+@RESPATH@/components/nsFormAutoComplete.js
+@RESPATH@/components/FormHistoryStartup.js
+@RESPATH@/components/nsInputListAutoComplete.js
+@RESPATH@/components/contentAreaDropListener.manifest
+@RESPATH@/components/contentAreaDropListener.js
+@RESPATH@/browser/components/BrowserProfileMigrators.manifest
+@RESPATH@/browser/components/ProfileMigrator.js
+@RESPATH@/browser/components/ChromeProfileMigrator.js
+@RESPATH@/browser/components/FirefoxProfileMigrator.js
+#ifdef XP_WIN
+@RESPATH@/browser/components/360seProfileMigrator.js
+@RESPATH@/browser/components/EdgeProfileMigrator.js
+@RESPATH@/browser/components/IEProfileMigrator.js
+#endif
 #ifdef XP_MACOSX
+@RESPATH@/browser/components/SafariProfileMigrator.js
 @RESPATH@/browser/components/MacTouchBar.manifest
 @RESPATH@/browser/components/MacTouchBar.js
 #endif
+@RESPATH@/components/nsPrompter.manifest
+@RESPATH@/components/nsPrompter.js
 @RESPATH@/components/SyncComponents.manifest
+@RESPATH@/components/Weave.js
+@RESPATH@/components/FxAccountsComponents.manifest
+@RESPATH@/components/FxAccountsPush.js
+@RESPATH@/components/CaptivePortalDetectComponents.manifest
+@RESPATH@/components/captivedetect.js
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/servicesSettings.manifest
+@RESPATH@/components/RemoteSettingsComponents.js
 @RESPATH@/components/cryptoComponents.manifest
+@RESPATH@/components/TelemetryStartup.js
+@RESPATH@/components/TelemetryStartup.manifest
+@RESPATH@/components/XULStore.js
+@RESPATH@/components/XULStore.manifest
+@RESPATH@/components/recording-cmdline.js
+@RESPATH@/components/recording-cmdline.manifest
+@RESPATH@/components/htmlMenuBuilder.js
+@RESPATH@/components/htmlMenuBuilder.manifest
+
+@RESPATH@/components/NotificationStorage.js
+@RESPATH@/components/NotificationStorage.manifest
+@RESPATH@/components/Push.js
+@RESPATH@/components/Push.manifest
+@RESPATH@/components/PushComponents.js
 
-@RESPATH@/components/Push.manifest
+@RESPATH@/components/remotebrowserutils.manifest
+@RESPATH@/components/RemoteWebNavigation.js
+
+@RESPATH@/components/ProcessSelector.js
+@RESPATH@/components/ProcessSelector.manifest
+
+@RESPATH@/components/SlowScriptDebug.manifest
+@RESPATH@/components/SlowScriptDebug.js
+
+@RESPATH@/components/ClearDataService.manifest
+@RESPATH@/components/ClearDataService.js
+
+#ifdef MOZ_WEBRTC
+@RESPATH@/components/PeerConnection.js
+@RESPATH@/components/PeerConnection.manifest
+#endif
 
 ; Remote control protocol
 #ifdef ENABLE_MARIONETTE
 @RESPATH@/chrome/marionette@JAREXT@
 @RESPATH@/chrome/marionette.manifest
 @RESPATH@/components/marionette.manifest
 @RESPATH@/components/marionette.js
 @RESPATH@/defaults/pref/marionette.js
 #endif
 
+@RESPATH@/components/nsAsyncShutdown.manifest
+@RESPATH@/components/nsAsyncShutdown.js
+
+@RESPATH@/components/BuiltinProviders.manifest
+@RESPATH@/components/PresentationControlService.js
+@RESPATH@/components/PresentationDataChannelSessionTransport.js
+@RESPATH@/components/PresentationDataChannelSessionTransport.manifest
+
+@RESPATH@/components/mozIntl.manifest
+@RESPATH@/components/mozIntl.js
+
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @RESPATH@/components/TestInterfaceJS.js
 @RESPATH@/components/TestInterfaceJS.manifest
 @RESPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
 #if defined(MOZ_DEBUG) || defined(MOZ_DEV_EDITION) || defined(NIGHTLY_BUILD)
 @RESPATH@/browser/components/testComponents.manifest
 @RESPATH@/browser/components/startupRecorder.js
 #endif
 
 ; [Extensions]
 @RESPATH@/components/extensions-toolkit.manifest
 @RESPATH@/browser/components/extensions-browser.manifest
 
+; [Normandy]
+@RESPATH@/components/shield.manifest
+@RESPATH@/components/shield-content-process.js
+
+; [PDF Viewer]
+@RESPATH@/browser/components/pdfjs.manifest
+@RESPATH@/browser/components/pdfjs.js
+
 ; Modules
 @RESPATH@/browser/modules/*
 @RESPATH@/modules/*
 @RESPATH@/browser/actors/*
 @RESPATH@/actors/*
 
+; Safe Browsing
+@RESPATH@/components/nsURLClassifier.manifest
+@RESPATH@/components/nsUrlClassifierHashCompleter.js
+@RESPATH@/components/nsUrlClassifierListManager.js
+@RESPATH@/components/nsUrlClassifierLib.js
+
 ; Security Reports
 @RESPATH@/components/SecurityReporter.manifest
 @RESPATH@/components/SecurityReporter.js
 
 ; ANGLE GLES-on-D3D rendering library
 #ifdef MOZ_ANGLE_RENDERER
 @BINPATH@/libEGL.dll
 @BINPATH@/libGLESv2.dll
@@ -395,16 +559,18 @@ bin/libfreebl_32int64_3.so
 #ifdef MOZ_MAINTENANCE_SERVICE
 @BINPATH@/maintenanceservice.exe
 @BINPATH@/maintenanceservice_installer.exe
 #endif
 
 ; [Crash Reporter]
 ;
 #ifdef MOZ_CRASHREPORTER
+@RESPATH@/components/CrashService.manifest
+@RESPATH@/components/CrashService.js
 #ifdef XP_MACOSX
 @BINPATH@/crashreporter.app/
 #else
 @BINPATH@/crashreporter@BIN_SUFFIX@
 @RESPATH@/crashreporter.ini
 @BINPATH@/minidump-analyzer@BIN_SUFFIX@
 #ifdef XP_UNIX
 @RESPATH@/Throbber-small.gif
@@ -416,16 +582,17 @@ bin/libfreebl_32int64_3.so
 #endif
 #endif
 
 ; [ Ping Sender ]
 ;
 @BINPATH@/pingsender@BIN_SUFFIX@
 
 ; Shutdown Terminator
+@RESPATH@/components/nsTerminatorTelemetry.js
 @RESPATH@/components/terminator.manifest
 
 #ifdef LLVM_SYMBOLIZER
 @BINPATH@/@LLVM_SYMBOLIZER@
 ; On Windows, llvm-symbolizer depends on the MS DIA library.
 #ifdef WIN_DIA_SDK_BIN_DIR
 @BINPATH@/msdia140.dll
 #endif
@@ -435,23 +602,36 @@ bin/libfreebl_32int64_3.so
 @BINPATH@/@MOZ_CLANG_RT_ASAN_LIB@
 #endif
 
 
 ; media
 @RESPATH@/gmp-clearkey/0.1/@DLL_PREFIX@clearkey@DLL_SUFFIX@
 @RESPATH@/gmp-clearkey/0.1/manifest.json
 
+; gfx
+#ifdef XP_WIN
+@RESPATH@/components/GfxSanityTest.manifest
+@RESPATH@/components/SanityTest.js
+#endif
+
 #ifdef MOZ_DMD
 ; DMD
 @RESPATH@/dmd.py
 @RESPATH@/fix_stack_using_bpsyms.py
 #ifdef XP_MACOSX
 @RESPATH@/fix_macosx_stack.py
 #endif
 #ifdef XP_LINUX
 @RESPATH@/fix_linux_stack.py
 #endif
 #endif
 
+; NOTE: This must match the config checks in
+; /toolkit/components/backgroundhangmonitor/moz.build.
+#if defined(NIGHTLY_BUILD) && !defined(MOZ_DEBUG) && !defined(MOZ_TSAN) && !defined(MOZ_ASAN)
+@RESPATH@/components/BHRTelemetryService.js
+@RESPATH@/components/BHRTelemetryService.manifest
+#endif
+
 #ifdef PKG_LOCALE_MANIFEST
 #include @PKG_LOCALE_MANIFEST@
 #endif
--- a/browser/modules/ContentClick.jsm
+++ b/browser/modules/ContentClick.jsm
@@ -10,17 +10,17 @@ var EXPORTED_SYMBOLS = [ "ContentClick" 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PlacesUIUtils",
                                "resource:///modules/PlacesUIUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
                                "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 var ContentClick = {
-  // Listeners are added in BrowserGlue.jsm
+  // Listeners are added in nsBrowserGlue.js
   receiveMessage(message) {
     switch (message.name) {
       case "Content:Click":
         this.contentAreaClick(message.json, message.target);
         break;
     }
   },
 
--- a/browser/modules/ContentSearch.jsm
+++ b/browser/modules/ContentSearch.jsm
@@ -148,17 +148,17 @@ var ContentSearch = {
    *         The MessageManager object of the selected browser.
    */
   focusInput(messageManager) {
     messageManager.sendAsyncMessage(OUTBOUND_MESSAGE, {
       type: "FocusInput",
     });
   },
 
-  // Listeners and observers are added in BrowserGlue.jsm
+  // Listeners and observers are added in nsBrowserGlue.js
   receiveMessage(msg) {
     // Add a temporary event handler that exists only while the message is in
     // the event queue.  If the message's source docshell changes browsers in
     // the meantime, then we need to update msg.target.  event.detail will be
     // the docshell's new parent <xul:browser> element.
     msg.handleEvent = event => {
       let browserData = this._suggestionMap.get(msg.target);
       if (browserData) {
--- a/browser/modules/FormValidationHandler.jsm
+++ b/browser/modules/FormValidationHandler.jsm
@@ -27,17 +27,17 @@ var FormValidationHandler =
   hidePopup() {
     this._hidePopup();
   },
 
   /*
    * Events
    */
 
-  // Listeners are added in BrowserGlue.jsm
+  // Listeners are added in nsBrowserGlue.js
   receiveMessage(aMessage) {
     let window = aMessage.target.ownerGlobal;
     let json = aMessage.json;
     let tabBrowser = window.gBrowser;
     switch (aMessage.name) {
       case "FormValidation:ShowPopup":
         // target is the <browser>, make sure we're receiving a message
         // from the foreground tab.
--- a/browser/modules/ReaderParent.jsm
+++ b/browser/modules/ReaderParent.jsm
@@ -10,17 +10,17 @@ var EXPORTED_SYMBOLS = [ "ReaderParent" 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
 
 const gStringBundle = Services.strings.createBundle("chrome://global/locale/aboutReader.properties");
 
 var ReaderParent = {
-  // Listeners are added in BrowserGlue.jsm
+  // Listeners are added in nsBrowserGlue.js
   receiveMessage(message) {
     switch (message.name) {
       case "Reader:FaviconRequest": {
         if (message.target.messageManager) {
           try {
             let preferredWidth = message.data.preferredWidth || 0;
             let uri = Services.io.newURI(message.data.url);
             PlacesUtils.favicons.getFaviconURLForPage(uri, iconUri => {
--- a/browser/modules/RemotePrompt.jsm
+++ b/browser/modules/RemotePrompt.jsm
@@ -8,17 +8,17 @@
 var EXPORTED_SYMBOLS = [ "RemotePrompt" ];
 
 ChromeUtils.defineModuleGetter(this, "PromptUtils",
                                "resource://gre/modules/SharedPromptUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "Services",
                                "resource://gre/modules/Services.jsm");
 
 var RemotePrompt = {
-  // Listeners are added in BrowserGlue.jsm
+  // Listeners are added in nsBrowserGlue.js
   receiveMessage(message) {
     switch (message.name) {
       case "Prompt:Open":
         if (message.data.uri) {
           this.openModalWindow(message.data, message.target);
         } else {
           this.openTabPrompt(message.data, message.target);
         }
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -196,17 +196,17 @@ var webrtcUI = {
   on(...args) {
     return this.emitter.on(...args);
   },
 
   off(...args) {
     return this.emitter.off(...args);
   },
 
-  // Listeners and observers are registered in BrowserGlue.jsm
+  // Listeners and observers are registered in nsBrowserGlue.js
   receiveMessage(aMessage) {
     switch (aMessage.name) {
       case "rtcpeer:Request": {
         let params = Object.freeze(Object.assign({
           origin: aMessage.target.contentPrincipal.origin,
         }, aMessage.data));
 
         let blockers = Array.from(this.peerConnectionBlockers);
--- a/browser/themes/shared/compacttheme.inc.css
+++ b/browser/themes/shared/compacttheme.inc.css
@@ -9,13 +9,13 @@
 :root:-moz-lwtheme {
   --toolbar-non-lwt-bgcolor: var(--toolbar-bgcolor);
   --toolbar-non-lwt-textcolor: var(--lwt-text-color);
   --toolbar-non-lwt-bgimage: none;
 }
 
 :root:-moz-lwtheme-brighttext {
   /* !important to override LightweightThemeManager.addBuiltInTheme in
-     BrowserGlue.jsm */
+     nsBrowserGlue.js */
   --autocomplete-popup-background: #2A2A2E !important;
   --autocomplete-popup-highlight-background: #0060DF;
 }
 
--- a/build/docs/defining-xpcom-components.rst
+++ b/build/docs/defining-xpcom-components.rst
@@ -97,22 +97,16 @@ Class definitions may have the following
   The fully-qualified name of a constructor function to call in order to
   create instances of this class. This function must be declared in one of the
   headers listed in the ``headers`` property, must take no arguments, and must
   return ``already_AddRefed<iface>`` where ``iface`` is the interface provided
   in the ``type`` property.
   
   This property is incompatible with ``legacy_constructor``.
 
-``jsm`` (optional)
-  If provided, must be the URL of a JavaScript module which contains a
-  JavaScript implementation of the component. The ``constructor`` property
-  must contain the name of an exported function which can be constructed to
-  create a new instance of the component.
-
 ``legacy_constructor`` (optional)
   This property is deprecated, and should not be used in new code.
   
   The fully-qualified name of a constructor function to call in order to
   create instances of this class. This function must be declared in one of the
   headers listed in the ``headers`` property, and must have the signature
   ``nsresult(nsISupports* aOuter, const nsID& aIID, void** aResult)``, and
   behave equivalently to ``nsIFactory::CreateInstance``.
--- a/chrome/test/unit/test_data_protocol_registration.js
+++ b/chrome/test/unit/test_data_protocol_registration.js
@@ -50,16 +50,17 @@ function run_test() {
       // to be restored later and register the new one.
       if (registrar.isContractIDRegistered(factory.contractID)) {
         dump(factory.scheme + " is already registered. Storing currently registered object for restoration later.");
         old_factories.push({
           CID: registrar.contractIDToCID(factory.contractID),
           factory: Components.manager.getClassObject(Cc[factory.contractID], Ci.nsIFactory),
         });
         old_factories_inds.push(true);
+        registrar.unregisterFactory(old_factories[i].CID, old_factories[i].factory);
       } else {
         dump(factory.scheme + " has never been registered. Registering...");
         old_factories.push({CID: "", factory: null});
         old_factories_inds.push(false);
       }
 
       registrar.registerFactory(factory.CID, "test-" + factory.scheme, factory.contractID, factory);
     } else {
@@ -89,12 +90,12 @@ function run_test() {
   // Unregister our factories so we do not leak
   for (let i = 0; i < factories.length; i++) {
     let factory = factories[i];
     let ind = old_factories_inds[i];
     registrar.unregisterFactory(factory.CID, factory);
 
     if (ind) {
       let old_factory = old_factories[i];
-      registrar.registerFactory(old_factory.CID, factory.scheme, factory.contractID, null);
+      registrar.registerFactory(old_factory.CID, factory.scheme, factory.contractID, old_factory.factory);
     }
   }
 }
--- a/chrome/test/unit/test_no_remote_registration.js
+++ b/chrome/test/unit/test_no_remote_registration.js
@@ -120,16 +120,17 @@ function run_test() {
   if (!registrar.isCIDRegistered(XULAppInfoFactory.CID)) {
     // Check to see if a contract was already registered and
     // register it if it is not. Otherwise, store the previous one
     // to be restored later and register the new one.
     if (registrar.isContractIDRegistered(XULAppInfoFactory.contractID)) {
       dump(XULAppInfoFactory.scheme + " is already registered. Storing currently registered object for restoration later.");
       old_factory.CID = registrar.contractIDToCID(XULAppInfoFactory.contractID);
       old_factory.factory = Components.manager.getClassObject(Cc[XULAppInfoFactory.contractID], Ci.nsIFactory);
+      registrar.unregisterFactory(old_factory.CID, old_factory.factory);
     } else {
       dump(XULAppInfoFactory.scheme + " has never been registered. Registering...");
     }
 
     registrar.registerFactory(XULAppInfoFactory.CID, "test-" + XULAppInfoFactory.scheme, XULAppInfoFactory.contractID, XULAppInfoFactory);
   } else {
     do_throw("CID " + XULAppInfoFactory.CID + " has already been registered!");
   }
@@ -208,11 +209,11 @@ function run_test() {
   for (let i = 0; i < factories.length; i++) {
     let factory = factories[i];
     registrar.unregisterFactory(factory.CID, factory);
   }
 
   // Unregister XULAppInfoFactory
   registrar.unregisterFactory(XULAppInfoFactory.CID, XULAppInfoFactory);
   if (old_factory.factory != null) {
-    registrar.registerFactory(old_factory.CID, "", XULAppInfoFactory.contractID, null);
+    registrar.registerFactory(old_factory.CID, "", XULAppInfoFactory.contractID, old_factory.factory);
   }
 }
deleted file mode 100644
--- a/devtools/platform/components.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{ec5aa99c-7abb-4142-ac5f-aab2419e38e2}',
-        'contract_ids': ['@mozilla.org/jsinspector;1'],
-        'type': 'mozilla::jsinspector::nsJSInspector',
-        'headers': ['/devtools/platform/nsJSInspector.h'],
-    },
-]
--- a/devtools/platform/moz.build
+++ b/devtools/platform/moz.build
@@ -11,13 +11,9 @@ XPIDL_SOURCES += [
 ]
 
 XPIDL_MODULE = 'jsinspector'
 
 SOURCES += [
     'nsJSInspector.cpp',
 ]
 
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
 FINAL_LIBRARY = 'xul'
--- a/devtools/platform/nsJSInspector.cpp
+++ b/devtools/platform/nsJSInspector.cpp
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsJSInspector.h"
 #include "nsIXPConnect.h"
 #include "nsThreadUtils.h"
 #include "jsfriendapi.h"
 #include "mozilla/HoldDropJSObjects.h"
+#include "mozilla/ModuleUtils.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsServiceManagerUtils.h"
 #include "nsMemory.h"
 #include "nsArray.h"
 #include "nsTArray.h"
 
 #define JSINSPECTOR_CONTRACTID "@mozilla.org/jsinspector;1"
 
@@ -21,16 +22,18 @@
     0xec5aa99c, 0x7abb, 0x4142, {                    \
       0xac, 0x5f, 0xaa, 0xb2, 0x41, 0x9e, 0x38, 0xe2 \
     }                                                \
   }
 
 namespace mozilla {
 namespace jsinspector {
 
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSInspector)
+
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsJSInspector)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsIJSInspector)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsJSInspector)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsJSInspector)
@@ -113,8 +116,23 @@ nsJSInspector::GetEventLoopNestLevel(uin
 NS_IMETHODIMP
 nsJSInspector::GetLastNestRequestor(JS::MutableHandle<JS::Value> out) {
   out.set(mLastRequestor);
   return NS_OK;
 }
 
 }  // namespace jsinspector
 }  // namespace mozilla
+
+NS_DEFINE_NAMED_CID(JSINSPECTOR_CID);
+
+static const mozilla::Module::CIDEntry kJSInspectorCIDs[] = {
+    {&kJSINSPECTOR_CID, false, nullptr,
+     mozilla::jsinspector::nsJSInspectorConstructor},
+    {nullptr}};
+
+static const mozilla::Module::ContractIDEntry kJSInspectorContracts[] = {
+    {JSINSPECTOR_CONTRACTID, &kJSINSPECTOR_CID}, {nullptr}};
+
+static const mozilla::Module kJSInspectorModule = {
+    mozilla::Module::kVersion, kJSInspectorCIDs, kJSInspectorContracts};
+
+NSMODULE_DEFN(jsinspector) = &kJSInspectorModule;
rename from devtools/startup/AboutDebuggingNewRegistration.jsm
rename to devtools/startup/aboutdebugging-new-registration.js
--- a/devtools/startup/AboutDebuggingNewRegistration.jsm
+++ b/devtools/startup/aboutdebugging-new-registration.js
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // This component is only registered and packaged for local and nightly builds in order to
 // open the new about:debugging when going to about:debugging-new, without having to flip
 // the preference. This allows running both versions of about:debugging side by side to
 // compare them.
+const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDebuggingNew() {}
 
 AboutDebuggingNew.prototype = {
   classDescription: "about:debugging-new",
@@ -32,9 +33,11 @@ AboutDebuggingNew.prototype = {
     return chan;
   },
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT;
   },
 };
 
-var EXPORTED_SYMBOLS = ["AboutDebuggingNew"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
+  AboutDebuggingNew,
+]);
new file mode 100644
--- /dev/null
+++ b/devtools/startup/aboutdebugging-new.manifest
@@ -0,0 +1,2 @@
+component {610e4e26-26bd-4a7d-aebc-69211d5a3be0} aboutdebugging-new-registration.js
+contract @mozilla.org/network/protocol/about;1?what=debugging-new {610e4e26-26bd-4a7d-aebc-69211d5a3be0}
rename from devtools/startup/AboutDebuggingRegistration.jsm
rename to devtools/startup/aboutdebugging-registration.js
--- a/devtools/startup/AboutDebuggingRegistration.jsm
+++ b/devtools/startup/aboutdebugging-registration.js
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // Register the about:debugging URL, that allows to debug various targets such as addons,
 // workers and tabs by launching a dedicated DevTools toolbox for the selected target.
 // If DevTools are not installed, this about page will display a shim landing page
 // encouraging the user to download and install DevTools.
+const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDebugging() {}
 
 AboutDebugging.prototype = {
   classDescription: "about:debugging",
@@ -34,9 +35,11 @@ AboutDebugging.prototype = {
     return chan;
   },
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT;
   },
 };
 
-var EXPORTED_SYMBOLS = ["AboutDebugging"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
+  AboutDebugging,
+]);
new file mode 100644
--- /dev/null
+++ b/devtools/startup/aboutdebugging.manifest
@@ -0,0 +1,2 @@
+component {1060afaf-dc9e-43da-8646-23a2faf48493} aboutdebugging-registration.js
+contract @mozilla.org/network/protocol/about;1?what=debugging {1060afaf-dc9e-43da-8646-23a2faf48493}
\ No newline at end of file
rename from devtools/startup/aboutdevtools/AboutDevToolsRegistration.jsm
rename to devtools/startup/aboutdevtools/aboutdevtools-registration.js
--- a/devtools/startup/aboutdevtools/AboutDevToolsRegistration.jsm
+++ b/devtools/startup/aboutdevtools/aboutdevtools-registration.js
@@ -1,16 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // Register the about:devtools URL, that is opened whenever a user attempts to open
 // DevTools for the first time.
+const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDevtools() {}
 
 AboutDevtools.prototype = {
   uri: Services.io.newURI("chrome://devtools-startup/content/aboutdevtools/aboutdevtools.xhtml"),
@@ -29,9 +30,11 @@ AboutDevtools.prototype = {
     return chan;
   },
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT;
   },
 };
 
-var EXPORTED_SYMBOLS = ["AboutDevtools"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
+  AboutDevtools,
+]);
new file mode 100644
--- /dev/null
+++ b/devtools/startup/aboutdevtools/aboutdevtools.manifest
@@ -0,0 +1,2 @@
+component {3a16d383-92bd-4c24-ac10-0e2bd66883ab} aboutdevtools-registration.js
+contract @mozilla.org/network/protocol/about;1?what=devtools {3a16d383-92bd-4c24-ac10-0e2bd66883ab}
deleted file mode 100644
--- a/devtools/startup/aboutdevtools/components.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{3a16d383-92bd-4c24-ac10-0e2bd66883ab}',
-        'contract_ids': ['@mozilla.org/network/protocol/about;1?what=devtools'],
-        'jsm': 'resource:///modules/AboutDevToolsRegistration.jsm',
-        'constructor': 'AboutDevtools',
-    },
-]
--- a/devtools/startup/aboutdevtools/moz.build
+++ b/devtools/startup/aboutdevtools/moz.build
@@ -1,15 +1,12 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXTRA_JS_MODULES += [
-  'AboutDevToolsRegistration.jsm',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_COMPONENTS += [
+  'aboutdevtools-registration.js',
+  'aboutdevtools.manifest',
 ]
 
 BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
rename from devtools/startup/AboutDevToolsToolboxRegistration.jsm
rename to devtools/startup/aboutdevtoolstoolbox-registration.js
--- a/devtools/startup/AboutDevToolsToolboxRegistration.jsm
+++ b/devtools/startup/aboutdevtoolstoolbox-registration.js
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // Register about:devtools-toolbox which allows to open a devtools toolbox
 // in a Firefox tab or a custom html iframe in browser.html
 
+const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDevtoolsToolbox() {}
 
 AboutDevtoolsToolbox.prototype = {
   uri: Services.io.newURI("chrome://devtools/content/framework/toolbox.xul"),
@@ -29,9 +30,11 @@ AboutDevtoolsToolbox.prototype = {
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT |
            nsIAboutModule.ENABLE_INDEXED_DB |
            nsIAboutModule.HIDE_FROM_ABOUTABOUT;
   },
 };
 
-var EXPORTED_SYMBOLS = ["AboutDevtoolsToolbox"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
+  AboutDevtoolsToolbox,
+]);
new file mode 100644
--- /dev/null
+++ b/devtools/startup/aboutdevtoolstoolbox.manifest
@@ -0,0 +1,2 @@
+component {11342911-3135-45a8-8d71-737a2b0ad469} aboutdevtoolstoolbox-registration.js
+contract @mozilla.org/network/protocol/about;1?what=devtools-toolbox {11342911-3135-45a8-8d71-737a2b0ad469}
\ No newline at end of file
deleted file mode 100644
--- a/devtools/startup/components.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = []
-
-if buildconfig.substs['MOZ_DEVTOOLS'] == 'all':
-    Classes += [
-        {
-            'cid': '{9e9a9283-0ce9-4e4a-8f1c-ba129a032c32}',
-            'contract_ids': ['@mozilla.org/devtools/startup-clh;1'],
-            'jsm': 'resource:///modules/DevToolsStartup.jsm',
-            'constructor': 'DevToolsStartup',
-            'categories': {'command-line-handler': 'm-devtools'},
-        },
-        {
-            'cid': '{1060afaf-dc9e-43da-8646-23a2faf48493}',
-            'contract_ids': ['@mozilla.org/network/protocol/about;1?what=debugging'],
-            'jsm': 'resource:///modules/AboutDebuggingRegistration.jsm',
-            'constructor': 'AboutDebugging',
-        },
-        {
-            'cid': '{11342911-3135-45a8-8d71-737a2b0ad469}',
-            'contract_ids': ['@mozilla.org/network/protocol/about;1?what=devtools-toolbox'],
-            'jsm': 'resource:///modules/AboutDevToolsToolboxRegistration.jsm',
-            'constructor': 'AboutDevtoolsToolbox',
-        },
-    ]
-
-if defined('NIGHTLY_BUILD'):
-    Classes += [
-        {
-            'cid': '{610e4e26-26bd-4a7d-aebc-69211d5a3be0}',
-            'contract_ids': ['@mozilla.org/network/protocol/about;1?what=debugging-new'],
-            'jsm': 'resource:///modules/AboutDebuggingNewRegistration.jsm',
-            'constructor': 'AboutDebuggingNew',
-        },
-    ]
rename from devtools/startup/DevToolsStartup.jsm
rename to devtools/startup/devtools-startup.js
--- a/devtools/startup/DevToolsStartup.jsm
+++ b/devtools/startup/devtools-startup.js
@@ -1002,9 +1002,10 @@ const JsonView = {
         onError(status) {
           throw new Error("JSON Viewer's onSave failed in startPersistence");
         },
       });
     }
   },
 };
 
-var EXPORTED_SYMBOLS = ["DevToolsStartup"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory(
+  [DevToolsStartup]);
new file mode 100644
--- /dev/null
+++ b/devtools/startup/devtools-startup.manifest
@@ -0,0 +1,3 @@
+component {9e9a9283-0ce9-4e4a-8f1c-ba129a032c32} devtools-startup.js
+contract @mozilla.org/devtools/startup-clh;1 {9e9a9283-0ce9-4e4a-8f1c-ba129a032c32}
+category command-line-handler m-devtools @mozilla.org/devtools/startup-clh;1
--- a/devtools/startup/moz.build
+++ b/devtools/startup/moz.build
@@ -7,32 +7,32 @@
 JAR_MANIFESTS += ['jar.mn']
 
 DIRS += [
     'preferences',
 ]
 
 # Register the startup components only for 'all' builds.
 if CONFIG['MOZ_DEVTOOLS'] == 'all':
-    EXTRA_JS_MODULES += [
-        'AboutDebuggingRegistration.jsm',
-        'AboutDevToolsToolboxRegistration.jsm',
-        'DevToolsStartup.jsm',
+    EXTRA_COMPONENTS += [
+        'aboutdebugging-registration.js',
+        'aboutdebugging.manifest',
+        'aboutdevtoolstoolbox-registration.js',
+        'aboutdevtoolstoolbox.manifest',
+        'devtools-startup.js',
+        'devtools-startup.manifest',
     ]
 
     DIRS += [
       'aboutdevtools',
       'locales',
     ]
 
 if CONFIG['NIGHTLY_BUILD']:
     EXTRA_COMPONENTS += [
-        'AboutDebuggingNewRegistration.jsm',
+        'aboutdebugging-new-registration.js',
+        'aboutdebugging-new.manifest',
     ]
 
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
 XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
 
 if CONFIG['MOZ_BUILD_APP'] != 'mobile/android':
     BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
rename from dom/base/ProcessSelector.jsm
rename to dom/base/ProcessSelector.js
--- a/dom/base/ProcessSelector.jsm
+++ b/dom/base/ProcessSelector.js
@@ -1,12 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
 // Fills up aProcesses until max and then selects randomly from the available
 // ones.
 function RandomSelector() {
 }
 
 RandomSelector.prototype = {
   classID:          Components.ID("{c616fcfd-9737-41f1-aa74-cee72a38f91b}"),
   QueryInterface:   ChromeUtils.generateQI([Ci.nsIContentProcessProvider]),
@@ -61,9 +63,10 @@ MinTabSelector.prototype = {
         candidate = i;
       }
     }
 
     return candidate;
   },
 };
 
-var EXPORTED_SYMBOLS = ["RandomSelector", "MinTabSelector"]
+var components = [RandomSelector, MinTabSelector];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
new file mode 100644
--- /dev/null
+++ b/dom/base/ProcessSelector.manifest
@@ -0,0 +1,3 @@
+component {c616fcfd-9737-41f1-aa74-cee72a38f91b} ProcessSelector.js
+component {2dc08eaf-6eef-4394-b1df-a3a927c1290b} ProcessSelector.js
+contract @mozilla.org/ipc/processselector;1 {2dc08eaf-6eef-4394-b1df-a3a927c1290b}
rename from dom/base/SlowScriptDebug.jsm
rename to dom/base/SlowScriptDebug.js
--- a/dom/base/SlowScriptDebug.jsm
+++ b/dom/base/SlowScriptDebug.js
@@ -1,20 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
 function SlowScriptDebug() { }
 
 SlowScriptDebug.prototype = {
+  classID: Components.ID("{e740ddb4-18b4-4aac-8ae1-9b0f4320769d}"),
   classDescription: "Slow script debug handler",
+  contractID: "@mozilla.org/dom/slow-script-debug;1",
   QueryInterface: ChromeUtils.generateQI([Ci.nsISlowScriptDebug]),
 
   get activationHandler()   { return this._activationHandler; },
   set activationHandler(cb) { return this._activationHandler = cb; },
 
   get remoteActivationHandler()   { return this._remoteActivationHandler; },
   set remoteActivationHandler(cb) { return this._remoteActivationHandler = cb; },
 };
 
-var EXPORTED_SYMBOLS = ["SlowScriptDebug"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SlowScriptDebug]);
new file mode 100644
--- /dev/null
+++ b/dom/base/SlowScriptDebug.manifest
@@ -0,0 +1,2 @@
+component {e740ddb4-18b4-4aac-8ae1-9b0f4320769d} SlowScriptDebug.js
+contract @mozilla.org/dom/slow-script-debug;1 {e740ddb4-18b4-4aac-8ae1-9b0f4320769d}
deleted file mode 100644
--- a/dom/base/components.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{1f34bc80-1bc7-11d6-a384-d705dd0746fc}',
-        'contract_ids': ['@mozilla.org/content/dropped-link-handler;1'],
-        'jsm': 'resource://gre/modules/ContentAreaDropListener.jsm',
-        'constructor': 'ContentAreaDropListener',
-    },
-    {
-        'cid': '{c616fcfd-9737-41f1-aa74-cee72a38f91b}',
-        'jsm': 'resource://gre/modules/ProcessSelector.jsm',
-        'constructor': 'RandomSelector',
-    },
-    {
-        'cid': '{2dc08eaf-6eef-4394-b1df-a3a927c1290b}',
-        'contract_ids': ['@mozilla.org/ipc/processselector;1'],
-        'jsm': 'resource://gre/modules/ProcessSelector.jsm',
-        'constructor': 'MinTabSelector',
-    },
-    {
-        'cid': '{e740ddb4-18b4-4aac-8ae1-9b0f4320769d}',
-        'contract_ids': ['@mozilla.org/dom/slow-script-debug;1'],
-        'jsm': 'resource://gre/modules/SlowScriptDebug.jsm',
-        'constructor': 'SlowScriptDebug',
-    },
-]
rename from dom/base/ContentAreaDropListener.jsm
rename to dom/base/contentAreaDropListener.js
--- a/dom/base/ContentAreaDropListener.jsm
+++ b/dom/base/contentAreaDropListener.js
@@ -1,13 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 
 // This component is used for handling dragover and drop of urls.
 //
 // It checks to see whether a drop of a url is allowed. For instance, a url
 // cannot be dropped if it is not a valid uri or the source of the drag cannot
 // access the uri. This prevents, for example, a source document from tricking
 // the user into dragging a chrome url.
@@ -309,9 +310,10 @@ ContentAreaDropListener.prototype =
       return false;
 
     return ownerDoc.defaultView
                    .windowUtils
                    .isNodeDisabledForEvents(aEvent.originalTarget);
   }
 };
 
-var EXPORTED_SYMBOLS = ["ContentAreaDropListener"];
+var components = [ContentAreaDropListener];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
new file mode 100644
--- /dev/null
+++ b/dom/base/contentAreaDropListener.manifest
@@ -0,0 +1,2 @@
+component {1f34bc80-1bc7-11d6-a384-d705dd0746fc} contentAreaDropListener.js
+contract @mozilla.org/content/dropped-link-handler;1 {1f34bc80-1bc7-11d6-a384-d705dd0746fc}
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -447,26 +447,28 @@ SOURCES += [
 ]
 
 # Are we targeting x86-32 or x86-64?  If so, we want to include SSE2 code for
 # nsTextFragment.cpp
 if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES += ['nsTextFragmentSSE2.cpp']
     SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
+EXTRA_COMPONENTS += [
+    'contentAreaDropListener.js',
+    'contentAreaDropListener.manifest',
+    'ProcessSelector.js',
+    'ProcessSelector.manifest',
+    'SlowScriptDebug.js',
+    'SlowScriptDebug.manifest',
+]
+
 EXTRA_JS_MODULES += [
-    'ContentAreaDropListener.jsm',
     'DOMRequestHelper.jsm',
     'IndexedDBHelper.jsm',
-    'ProcessSelector.jsm',
-    'SlowScriptDebug.jsm',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
 ]
 
 LOCAL_INCLUDES += [
     '../battery',
     '../events',
     '../media',
     '../network',
     '/caps',
--- a/dom/base/test/test_bug715041.xul
+++ b/dom/base/test/test_bug715041.xul
@@ -715,17 +715,17 @@ target="_blank">Mozilla Bug 715041</a>
     try {
       componentMgr.unregisterFactory(idleServiceCID, idleServiceObj);
     }
     catch(err) {
       dump("test_bug715041.xul: ShiftLocalTimerBackCleanUp() Failed to unregister factory, mock idle service!\n");
     }
 
     try {
-      componentMgr.registerFactory(oldIdleServiceCID, "Re registering old idle service", idleServiceContractID, null);
+      componentMgr.registerFactory(oldIdleServiceCID, "Re registering old idle service", idleServiceContractID, oldIdleServiceFactoryObj);
     }
     catch(err) {
       dump("test_bug715041.xul: ShiftLocalTimerBackCleanUp() Failed to register factory, original idle service!\n");
     }
 
     SimpleTest.finish();
   }
 
@@ -780,16 +780,23 @@ target="_blank">Mozilla Bug 715041</a>
   try {
     var oldIdleServiceCID = componentMgr.contractIDToCID(idleServiceContractID);
   }
   catch(err) {
     dump("test_bug715041.xul: Failed to convert ID to CID for old idle service.\n");
   }
 
   try {
+    componentMgr.unregisterFactory(oldIdleServiceCID, oldIdleServiceFactoryObj);
+  }
+  catch(err) {
+    dump("test_bug715041.xul: Failed to unregister old idle service factory object!\n");
+  }
+
+  try {
     componentMgr.registerFactory(idleServiceCID, "Test Simple Idle/Back Notifications", idleServiceContractID, idleServiceObj);
   }
   catch(err) {
     dump("test_bug715041.xul: Failed to register mock idle service.\n");
   }
 
   SimpleTest.waitForExplicitFinish();
   SimpleTest.requestLongerTimeout(10);
--- a/dom/base/test/test_bug715041_removal.xul
+++ b/dom/base/test/test_bug715041_removal.xul
@@ -760,17 +760,17 @@ target="_blank">Mozilla Bug 715041</a>
     try {
       componentMgr.unregisterFactory(idleServiceCID, idleServiceObj);
     }
     catch(err) {
       dump("test_bug715041_removal.xul: RemoveLastAddLastCleanUp() Failed to unregister factory, mock idle service!\n");
     }
 
     try {
-      componentMgr.registerFactory(oldIdleServiceCID, "Re registering old idle service", idleServiceContractID, null);
+      componentMgr.registerFactory(oldIdleServiceCID, "Re registering old idle service", idleServiceContractID, oldIdleServiceFactoryObj);
     }
     catch(err) {
       dump("test_bug715041_removal.xul: RemoveLastAddLastCleanUp() Failed to register factory, original idle service!\n");
     }
 
     dump("JS RemoveLastAddLastCleanUp() DONE\n");
     dump("Finishing testing idle API.\n");
     SimpleTest.finish();
@@ -808,16 +808,23 @@ target="_blank">Mozilla Bug 715041</a>
   try {
     var oldIdleServiceCID = componentMgr.contractIDToCID(idleServiceContractID);
   }
   catch(err) {
     dump("test_bug715041._removalxul: Failed to convert ID to CID for old idle service.\n");
   }
 
   try {
+    componentMgr.unregisterFactory(oldIdleServiceCID, oldIdleServiceFactoryObj);
+  }
+  catch(err) {
+    dump("test_bug715041_removal.xul: Failed to unregister old idle service factory object!\n");
+  }
+
+  try {
     componentMgr.registerFactory(idleServiceCID, "Test Simple Idle/Back Notifications", idleServiceContractID, idleServiceObj);
   }
   catch(err) {
     dump("test_bug715041_removal.xul: Failed to register mock idle service.\n");
   }
 
   //test case enabled
   var RemoveLocalIdleObserverWhileIdleEnabled = true;
rename from dom/browser-element/BrowserElementParent.jsm
rename to dom/browser-element/BrowserElementParent.js
--- a/dom/browser-element/BrowserElementParent.jsm
+++ b/dom/browser-element/BrowserElementParent.js
@@ -5,16 +5,17 @@
 "use strict";
 
 /* BrowserElementParent injects script to listen for certain events in the
  * child.  We then listen to messages from the child script and take
  * appropriate action here in the parent.
  */
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {BrowserElementPromptService} = ChromeUtils.import("resource://gre/modules/BrowserElementPromptService.jsm");
 
 function debug(msg) {
   //dump("BrowserElementParent - " + msg + "\n");
 }
 
 function getIntPref(prefName, def) {
   try {
@@ -616,9 +617,9 @@ BrowserElementParent.prototype = {
       break;
     default:
       debug('Unknown topic: ' + topic);
       break;
     };
   },
 };
 
-var EXPORTED_SYMBOLS = ["BrowserElementParent"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserElementParent]);
new file mode 100644
--- /dev/null
+++ b/dom/browser-element/BrowserElementParent.manifest
@@ -0,0 +1,2 @@
+component {9f171ac4-0939-4ef8-b360-3408aedc3060} BrowserElementParent.js
+contract @mozilla.org/dom/browser-element-api;1 {9f171ac4-0939-4ef8-b360-3408aedc3060}
--- a/dom/browser-element/BrowserElementPromptService.jsm
+++ b/dom/browser-element/BrowserElementPromptService.jsm
@@ -591,16 +591,18 @@ var BrowserElementPromptService = {
     var newCID = BrowserElementPromptFactory.prototype.classID;
     var oldFactory = Cm.getClassObject(Cc[contractID], Ci.nsIFactory);
 
     if (oldCID == newCID) {
       debug("WARNING: Wrapped prompt factory is already installed!");
       return;
     }
 
+    Cm.unregisterFactory(oldCID, oldFactory);
+
     var oldInstance = oldFactory.createInstance(null, Ci.nsIPromptFactory);
     var newInstance = new BrowserElementPromptFactory(oldInstance);
 
     var newFactory = {
       createInstance: function(outer, iid) {
         if (outer != null) {
           throw Cr.NS_ERROR_NO_AGGREGATION;
         }
deleted file mode 100644
--- a/dom/browser-element/components.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{9f171ac4-0939-4ef8-b360-3408aedc3060}',
-        'contract_ids': ['@mozilla.org/dom/browser-element-api;1'],
-        'jsm': 'resource://gre/modules/BrowserElementParent.jsm',
-        'constructor': 'BrowserElementParent',
-    },
-]
--- a/dom/browser-element/moz.build
+++ b/dom/browser-element/moz.build
@@ -16,23 +16,23 @@ SOURCES += [
 ]
 
 XPIDL_SOURCES += [
     'nsIBrowserElementAPI.idl',
 ]
 
 XPIDL_MODULE = 'browser-element'
 
-EXTRA_JS_MODULES += [
-    'BrowserElementParent.jsm',
-    'BrowserElementPromptService.jsm',
+EXTRA_COMPONENTS += [
+    'BrowserElementParent.js',
+    'BrowserElementParent.manifest',
 ]
 
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_JS_MODULES += [
+    'BrowserElementPromptService.jsm',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/html',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
new file mode 100644
--- /dev/null
+++ b/dom/console/ConsoleAPI.manifest
@@ -0,0 +1,2 @@
+component {96cf7855-dfa9-4c6d-8276-f9705b4890f2} ConsoleAPIStorage.js
+contract @mozilla.org/consoleAPI-storage;1 {96cf7855-dfa9-4c6d-8276-f9705b4890f2}
rename from dom/console/ConsoleAPIStorage.jsm
rename to dom/console/ConsoleAPIStorage.js
--- a/dom/console/ConsoleAPIStorage.jsm
+++ b/dom/console/ConsoleAPIStorage.js
@@ -1,16 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
+// This constant tells how many messages to process in a single timer execution.
+const MESSAGES_IN_INTERVAL = 1500;
+
 const STORAGE_MAX_EVENTS = 1000;
 
 var _consoleStorage = new Map();
 
 const CONSOLEAPISTORAGE_CID = Components.ID("{96cf7855-dfa9-4c6d-8276-f9705b4890f2}");
 
 /**
  * The ConsoleAPIStorage is meant to cache window.console API calls for later
@@ -133,9 +137,9 @@ ConsoleAPIStorageService.prototype = {
       _consoleStorage.delete(aId);
     } else {
       _consoleStorage.clear();
       Services.obs.notifyObservers(null, "console-storage-reset");
     }
   },
 };
 
-var EXPORTED_SYMBOLS = ["ConsoleAPIStorageService"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ConsoleAPIStorageService]);
deleted file mode 100644
--- a/dom/console/components.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{96cf7855-dfa9-4c6d-8276-f9705b4890f2}',
-        'contract_ids': ['@mozilla.org/consoleAPI-storage;1'],
-        'jsm': 'resource://gre/modules/ConsoleAPIStorage.jsm',
-        'constructor': 'ConsoleAPIStorageService',
-    },
-]
--- a/dom/console/moz.build
+++ b/dom/console/moz.build
@@ -29,22 +29,19 @@ EXPORTS.mozilla.dom += [
 
 UNIFIED_SOURCES += [
     'Console.cpp',
     'ConsoleInstance.cpp',
     'ConsoleReportCollector.cpp',
     'ConsoleUtils.cpp',
 ]
 
-EXTRA_JS_MODULES += [
-    'ConsoleAPIStorage.jsm',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_COMPONENTS += [
+    'ConsoleAPI.manifest',
+    'ConsoleAPIStorage.js',
 ]
 
 LOCAL_INCLUDES += [
     '/docshell/base',
     '/dom/base',
     '/js/xpconnect/src',
 ]
 
--- a/dom/file/uri/BlobURLProtocolHandler.cpp
+++ b/dom/file/uri/BlobURLProtocolHandler.cpp
@@ -12,16 +12,17 @@
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/Exceptions.h"
 #include "mozilla/dom/BlobImpl.h"
 #include "mozilla/dom/IPCBlobUtils.h"
 #include "mozilla/dom/MediaSource.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/LoadInfo.h"
+#include "mozilla/ModuleUtils.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/SystemGroup.h"
 #include "nsClassHashtable.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
 #include "nsIAsyncShutdown.h"
 #include "nsIException.h"  // for nsIStackFrame
@@ -902,16 +903,43 @@ nsresult NS_GetSourceForMediaSourceURI(n
   RefPtr<MediaSource> mediaSource = info->mMediaSource;
   mediaSource.forget(aSource);
   return NS_OK;
 }
 
 namespace mozilla {
 namespace dom {
 
+#define NS_BLOBPROTOCOLHANDLER_CID                   \
+  {                                                  \
+    0xb43964aa, 0xa078, 0x44b2, {                    \
+      0xb0, 0x6b, 0xfd, 0x4d, 0x1b, 0x17, 0x2e, 0x66 \
+    }                                                \
+  }
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(BlobURLProtocolHandler)
+
+NS_DEFINE_NAMED_CID(NS_BLOBPROTOCOLHANDLER_CID);
+
+static const Module::CIDEntry kBlobURLProtocolHandlerCIDs[] = {
+    {&kNS_BLOBPROTOCOLHANDLER_CID, false, nullptr,
+     BlobURLProtocolHandlerConstructor},
+    {nullptr}};
+
+static const Module::ContractIDEntry kBlobURLProtocolHandlerContracts[] = {
+    {NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX BLOBURI_SCHEME,
+     &kNS_BLOBPROTOCOLHANDLER_CID},
+    {nullptr}};
+
+static const Module kBlobURLProtocolHandlerModule = {
+    Module::kVersion, kBlobURLProtocolHandlerCIDs,
+    kBlobURLProtocolHandlerContracts};
+
+NSMODULE_DEFN(BlobURLProtocolHandler) = &kBlobURLProtocolHandlerModule;
+
 bool IsType(nsIURI* aUri, DataInfo::ObjectType aType) {
   DataInfo* info = GetDataInfoFromURI(aUri);
   if (!info) {
     return false;
   }
 
   return info->mObjectType == aType;
 }
--- a/dom/file/uri/FontTableURIProtocolHandler.cpp
+++ b/dom/file/uri/FontTableURIProtocolHandler.cpp
@@ -1,19 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "FontTableURIProtocolHandler.h"
-#include "nsIURIMutator.h"
-#include "nsIUUIDGenerator.h"
+#include "mozilla/ModuleUtils.h"
 #include "nsNetUtil.h"
-#include "nsSimpleURI.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 /* static */ nsresult FontTableURIProtocolHandler::GenerateURIString(
     nsACString &aUri) {
   nsresult rv;
   nsCOMPtr<nsIUUIDGenerator> uuidgen =
@@ -109,8 +107,36 @@ FontTableURIProtocolHandler::NewURI(cons
   if (NS_FAILED(uri->SchemeIs(FONTTABLEURI_SCHEME, &schemeIs)) || !schemeIs) {
     NS_WARNING("Non-fonttable spec in FontTableURIProtocolHandler");
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   uri.forget(aResult);
   return NS_OK;
 }
+
+#define NS_FONTTABLEPROTOCOLHANDLER_CID              \
+  {                                                  \
+    0x3fc8f04e, 0xd719, 0x43ca, {                    \
+      0x9a, 0xd0, 0x18, 0xee, 0x32, 0x02, 0x11, 0xf2 \
+    }                                                \
+  }
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(FontTableURIProtocolHandler)
+
+NS_DEFINE_NAMED_CID(NS_FONTTABLEPROTOCOLHANDLER_CID);
+
+static const mozilla::Module::CIDEntry FontTableURIProtocolHandlerCIDs[] = {
+    {&kNS_FONTTABLEPROTOCOLHANDLER_CID, false, nullptr,
+     FontTableURIProtocolHandlerConstructor},
+    {nullptr}};
+
+static const mozilla::Module::ContractIDEntry
+    FontTableURIProtocolHandlerContracts[] = {
+        {NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX FONTTABLEURI_SCHEME,
+         &kNS_FONTTABLEPROTOCOLHANDLER_CID},
+        {nullptr}};
+
+static const mozilla::Module FontTableURIProtocolHandlerModule = {
+    mozilla::Module::kVersion, FontTableURIProtocolHandlerCIDs,
+    FontTableURIProtocolHandlerContracts};
+
+NSMODULE_DEFN(FontTableURIProtocolHandler) = &FontTableURIProtocolHandlerModule;
deleted file mode 100644
--- a/dom/file/uri/components.conf
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{3fc8f04e-d719-43ca-9ad0-18ee320211f2}',
-        'contract_ids': ['@mozilla.org/network/protocol;1?name=moz-fonttable'],
-        'type': 'mozilla::dom::FontTableURIProtocolHandler',
-        'headers': ['mozilla/dom/FontTableURIProtocolHandler.h'],
-    },
-    {
-        'cid': '{b43964aa-a078-44b2-b06b-fd4d1b172e66}',
-        'contract_ids': ['@mozilla.org/network/protocol;1?name=blob'],
-        'type': 'mozilla::dom::BlobURLProtocolHandler',
-        'headers': ['mozilla/dom/BlobURLProtocolHandler.h'],
-    },
-]
--- a/dom/file/uri/moz.build
+++ b/dom/file/uri/moz.build
@@ -15,20 +15,16 @@ EXPORTS.mozilla.dom += [
 
 UNIFIED_SOURCES += [
     'BlobURL.cpp',
     'BlobURLChannel.cpp',
     'BlobURLProtocolHandler.cpp',
     'FontTableURIProtocolHandler.cpp',
 ]
 
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
 LOCAL_INCLUDES += [
     '/dom/file',
     '/netwerk/base',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/dom/html/components.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{51c65f5d-0de5-4edc-9058-60e50cef77f8}',
-        'contract_ids': ['@mozilla.org/content/html-menu-builder;1'],
-        'jsm': 'resource://gre/modules/HTMLMenuBuilder.jsm',
-        'constructor': 'HTMLMenuBuilder',
-    },
-]
rename from dom/html/HTMLMenuBuilder.jsm
rename to dom/html/htmlMenuBuilder.js
--- a/dom/html/HTMLMenuBuilder.jsm
+++ b/dom/html/htmlMenuBuilder.js
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // This component is used to build the menus for the HTML contextmenu attribute.
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
 // A global value that is used to identify each menu item. It is
 // incremented with each one that is found.
 var gGeneratedId = 1;
 
 function HTMLMenuBuilder() {
   this.currentNode = null;
   this.root = null;
   this.items = {};
@@ -124,9 +126,9 @@ HTMLMenuBuilder.prototype =
   click: function(id) {
     let item = this.items[id];
     if (item) {
       item.click();
     }
   }
 };
 
-var EXPORTED_SYMBOLS = ["HTMLMenuBuilder"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HTMLMenuBuilder]);
new file mode 100644
--- /dev/null
+++ b/dom/html/htmlMenuBuilder.manifest
@@ -0,0 +1,3 @@
+component {51c65f5d-0de5-4edc-9058-60e50cef77f8} htmlMenuBuilder.js
+contract @mozilla.org/content/html-menu-builder;1 {51c65f5d-0de5-4edc-9058-60e50cef77f8}
+
--- a/dom/html/moz.build
+++ b/dom/html/moz.build
@@ -222,22 +222,19 @@ UNIFIED_SOURCES += [
     'VideoDocument.cpp',
 ]
 
 SOURCES += [
     # Includes npapi.h.
     'PluginDocument.cpp',
 ]
 
-EXTRA_JS_MODULES += [
-    'HTMLMenuBuilder.jsm',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_COMPONENTS += [
+    'htmlMenuBuilder.js',
+    'htmlMenuBuilder.manifest'
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/caps',
     '/docshell/base',
     '/dom/base',
rename from dom/media/PeerConnection.jsm
rename to dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.jsm
+++ b/dom/media/PeerConnection.js
@@ -1,25 +1,29 @@
 /* jshint moz:true, browser:true */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "PeerConnectionIdp",
   "resource://gre/modules/media/PeerConnectionIdp.jsm");
 ChromeUtils.defineModuleGetter(this, "convertToRTCStatsReport",
   "resource://gre/modules/media/RTCStatsReport.jsm");
+ChromeUtils.defineModuleGetter(this, "AppConstants",
+  "resource://gre/modules/AppConstants.jsm");
 
 const PC_CONTRACT = "@mozilla.org/dom/peerconnection;1";
 const PC_OBS_CONTRACT = "@mozilla.org/dom/peerconnectionobserver;1";
 const PC_ICE_CONTRACT = "@mozilla.org/dom/rtcicecandidate;1";
 const PC_SESSION_CONTRACT = "@mozilla.org/dom/rtcsessiondescription;1";
+const PC_MANAGER_CONTRACT = "@mozilla.org/dom/peerconnectionmanager;1";
 const PC_STATS_CONTRACT = "@mozilla.org/dom/rtcstatsreport;1";
 const PC_STATIC_CONTRACT = "@mozilla.org/dom/peerconnectionstatic;1";
 const PC_SENDER_CONTRACT = "@mozilla.org/dom/rtpsender;1";
 const PC_RECEIVER_CONTRACT = "@mozilla.org/dom/rtpreceiver;1";
 const PC_TRANSCEIVER_CONTRACT = "@mozilla.org/dom/rtptransceiver;1";
 const PC_COREQUEST_CONTRACT = "@mozilla.org/dom/createofferrequest;1";
 const PC_DTMF_SENDER_CONTRACT = "@mozilla.org/dom/rtcdtmfsender;1";
 
@@ -2376,21 +2380,22 @@ class CreateOfferRequest {
   }
 }
 setupPrototype(CreateOfferRequest, {
   classID: PC_COREQUEST_CID,
   contractID: PC_COREQUEST_CONTRACT,
   QueryInterface: ChromeUtils.generateQI([]),
 });
 
-var EXPORTED_SYMBOLS =
-  ["GlobalPCList",
-   "RTCDTMFSender",
-   "RTCIceCandidate",
-   "RTCSessionDescription",
-   "RTCPeerConnection",
-   "RTCPeerConnectionStatic",
-   "RTCRtpReceiver",
-   "RTCRtpSender",
-   "RTCRtpTransceiver",
-   "RTCStatsReport",
-   "PeerConnectionObserver",
-   "CreateOfferRequest"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory(
+  [GlobalPCList,
+   RTCDTMFSender,
+   RTCIceCandidate,
+   RTCSessionDescription,
+   RTCPeerConnection,
+   RTCPeerConnectionStatic,
+   RTCRtpReceiver,
+   RTCRtpSender,
+   RTCRtpTransceiver,
+   RTCStatsReport,
+   PeerConnectionObserver,
+   CreateOfferRequest]
+);
new file mode 100644
--- /dev/null
+++ b/dom/media/PeerConnection.manifest
@@ -0,0 +1,23 @@
+component {bdc2e533-b308-4708-ac8e-a8bfade6d851} PeerConnection.js
+component {d1748d4c-7f6a-4dc5-add6-d55b7678537e} PeerConnection.js
+component {02b9970c-433d-4cc2-923d-f7028ac66073} PeerConnection.js
+component {1775081b-b62d-4954-8ffe-a067bbf508a7} PeerConnection.js
+component {7293e901-2be3-4c02-b4bd-cbef6fc24f78} PeerConnection.js
+component {7fe6e18b-0da3-4056-bf3b-440ef3809e06} PeerConnection.js
+component {0fb47c47-a205-4583-a9fc-cbadf8c95880} PeerConnection.js
+component {4fff5d46-d827-4cd4-a970-8fd53977440e} PeerConnection.js
+component {d974b814-8fde-411c-8c45-b86791b81030} PeerConnection.js
+component {74b2122d-65a8-4824-aa9e-3d664cb75dc2} PeerConnection.js
+component {3610C242-654E-11E6-8EC0-6D1BE389A607} PeerConnection.js
+
+contract @mozilla.org/dom/peerconnection;1 {bdc2e533-b308-4708-ac8e-a8bfade6d851}
+contract @mozilla.org/dom/peerconnectionobserver;1 {d1748d4c-7f6a-4dc5-add6-d55b7678537e}
+contract @mozilla.org/dom/rtcdtmfsender;1 {3610C242-654E-11E6-8EC0-6D1BE389A607}
+contract @mozilla.org/dom/rtcicecandidate;1 {02b9970c-433d-4cc2-923d-f7028ac66073}
+contract @mozilla.org/dom/rtcsessiondescription;1 {1775081b-b62d-4954-8ffe-a067bbf508a7}
+contract @mozilla.org/dom/peerconnectionmanager;1 {7293e901-2be3-4c02-b4bd-cbef6fc24f78}
+contract @mozilla.org/dom/rtcstatsreport;1 {7fe6e18b-0da3-4056-bf3b-440ef3809e06}
+contract @mozilla.org/dom/peerconnectionstatic;1 {0fb47c47-a205-4583-a9fc-cbadf8c95880}
+contract @mozilla.org/dom/rtpsender;1 {4fff5d46-d827-4cd4-a970-8fd53977440e}
+contract @mozilla.org/dom/rtpreceiver;1 {d974b814-8fde-411c-8c45-b86791b81030}
+contract @mozilla.org/dom/createofferrequest;1 {74b2122d-65a8-4824-aa9e-3d664cb75dc2}
--- a/dom/media/bridge/MediaModule.cpp
+++ b/dom/media/bridge/MediaModule.cpp
@@ -1,16 +1,59 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "mozilla/Components.h"
+#include "mozilla/ModuleUtils.h"
+#include "nsIClassInfoImpl.h"
 
 #ifdef MOZ_WEBRTC
+
 #  include "PeerConnectionImpl.h"
 
-using namespace mozilla;
+#  define PEERCONNECTION_CID                           \
+    {                                                  \
+      0xb93af7a1, 0x3411, 0x44a8, {                    \
+        0xbd, 0x0a, 0x8a, 0xf3, 0xdd, 0xe4, 0xd8, 0xd8 \
+      }                                                \
+    }
+
+#  define PEERCONNECTION_CONTRACTID "@mozilla.org/peerconnection;1"
+
+#  include "stun_socket_filter.h"
+
+NS_DEFINE_NAMED_CID(NS_STUN_UDP_SOCKET_FILTER_HANDLER_CID)
+NS_DEFINE_NAMED_CID(NS_STUN_TCP_SOCKET_FILTER_HANDLER_CID)
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsStunUDPSocketFilterHandler)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsStunTCPSocketFilterHandler)
+
+namespace mozilla {
+// Factory defined in mozilla::, defines mozilla::PeerConnectionImplConstructor
+NS_GENERIC_FACTORY_CONSTRUCTOR(PeerConnectionImpl)
+}  // namespace mozilla
 
-NS_IMPL_COMPONENT_FACTORY(mozilla::PeerConnectionImpl) {
-  return do_AddRef(new PeerConnectionImpl()).downcast<nsISupports>();
-}
+// Defines kPEERCONNECTION_CID
+NS_DEFINE_NAMED_CID(PEERCONNECTION_CID);
+
+static const mozilla::Module::CIDEntry kCIDs[] = {
+    {&kPEERCONNECTION_CID, false, nullptr,
+     mozilla::PeerConnectionImplConstructor},
+    {&kNS_STUN_UDP_SOCKET_FILTER_HANDLER_CID, false, nullptr,
+     nsStunUDPSocketFilterHandlerConstructor},
+    {&kNS_STUN_TCP_SOCKET_FILTER_HANDLER_CID, false, nullptr,
+     nsStunTCPSocketFilterHandlerConstructor},
+    {nullptr}};
+
+static const mozilla::Module::ContractIDEntry kContracts[] = {
+    {PEERCONNECTION_CONTRACTID, &kPEERCONNECTION_CID},
+    {NS_STUN_UDP_SOCKET_FILTER_HANDLER_CONTRACTID,
+     &kNS_STUN_UDP_SOCKET_FILTER_HANDLER_CID},
+    {NS_STUN_TCP_SOCKET_FILTER_HANDLER_CONTRACTID,
+     &kNS_STUN_TCP_SOCKET_FILTER_HANDLER_CID},
+    {nullptr}};
+
+static const mozilla::Module kModule = {mozilla::Module::kVersion, kCIDs,
+                                        kContracts};
+
+NSMODULE_DEFN(peerconnection) = &kModule;
 
 #endif
deleted file mode 100644
--- a/dom/media/bridge/components.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{b93af7a1-3411-44a8-bd0a-8af3dde4d8d8}',
-        'contract_ids': ['@mozilla.org/peerconnection;1'],
-        'type': 'mozilla::PeerConnectionImpl',
-    },
-    {
-        'cid': '{9fea635a-2fc2-4d08-9721-d238d3f52f92}',
-        'contract_ids': ['@mozilla.org/network/tcp-filter-handler;1?name=stun'],
-        'type': 'nsStunTCPSocketFilterHandler',
-        'headers': ['mtransport/stun_socket_filter.h'],
-    },
-    {
-        'cid': '{3e43ee93-829e-4ea6-a34e-62d9e4c9f993}',
-        'contract_ids': ['@mozilla.org/network/udp-filter-handler;1?name=stun'],
-        'type': 'nsStunUDPSocketFilterHandler',
-        'headers': ['mtransport/stun_socket_filter.h'],
-    },
-]
--- a/dom/media/bridge/moz.build
+++ b/dom/media/bridge/moz.build
@@ -21,17 +21,12 @@ LOCAL_INCLUDES += [
     '/media/webrtc/',
     '/media/webrtc/signaling/src/common/time_profiling',
     '/media/webrtc/signaling/src/media-conduit',
     '/media/webrtc/signaling/src/mediapipeline',
     '/media/webrtc/signaling/src/peerconnection',
     '/media/webrtc/trunk/',
 ]
 
-if CONFIG['MOZ_WEBRTC']:
-    XPCOM_MANIFESTS += [
-        'components.conf',
-    ]
-
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
deleted file mode 100644
--- a/dom/media/components.conf
+++ /dev/null
@@ -1,74 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{bdc2e533-b308-4708-ac8e-a8bfade6d851}',
-        'contract_ids': ['@mozilla.org/dom/peerconnection;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'RTCPeerConnection',
-    },
-    {
-        'cid': '{d1748d4c-7f6a-4dc5-add6-d55b7678537e}',
-        'contract_ids': ['@mozilla.org/dom/peerconnectionobserver;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'PeerConnectionObserver',
-    },
-    {
-        'cid': '{3610C242-654E-11E6-8EC0-6D1BE389A607}',
-        'contract_ids': ['@mozilla.org/dom/rtcdtmfsender;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'RTCDTMFSender',
-    },
-    {
-        'cid': '{02b9970c-433d-4cc2-923d-f7028ac66073}',
-        'contract_ids': ['@mozilla.org/dom/rtcicecandidate;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'RTCIceCandidate',
-    },
-    {
-        'cid': '{1775081b-b62d-4954-8ffe-a067bbf508a7}',
-        'contract_ids': ['@mozilla.org/dom/rtcsessiondescription;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'RTCSessionDescription',
-    },
-    {
-        'cid': '{7293e901-2be3-4c02-b4bd-cbef6fc24f78}',
-        'contract_ids': ['@mozilla.org/dom/peerconnectionmanager;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'GlobalPCList',
-    },
-    {
-        'cid': '{7fe6e18b-0da3-4056-bf3b-440ef3809e06}',
-        'contract_ids': ['@mozilla.org/dom/rtcstatsreport;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'RTCStatsReport',
-    },
-    {
-        'cid': '{0fb47c47-a205-4583-a9fc-cbadf8c95880}',
-        'contract_ids': ['@mozilla.org/dom/peerconnectionstatic;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'RTCPeerConnectionStatic',
-    },
-    {
-        'cid': '{4fff5d46-d827-4cd4-a970-8fd53977440e}',
-        'contract_ids': ['@mozilla.org/dom/rtpsender;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'RTCRtpSender',
-    },
-    {
-        'cid': '{d974b814-8fde-411c-8c45-b86791b81030}',
-        'contract_ids': ['@mozilla.org/dom/rtpreceiver;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'RTCRtpReceiver',
-    },
-    {
-        'cid': '{74b2122d-65a8-4824-aa9e-3d664cb75dc2}',
-        'contract_ids': ['@mozilla.org/dom/createofferrequest;1'],
-        'jsm': 'resource://gre/modules/media/PeerConnection.jsm',
-        'constructor': 'CreateOfferRequest',
-    },
-]
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -302,24 +302,20 @@ SOURCES += [
     'DecoderTraits.cpp',
 ]
 
 # Some codec-related code uses multi-character constants, which GCC and clang
 # warn about. Suppress turning this warning into an error.
 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
   SOURCES['DecoderTraits.cpp'].flags += ['-Wno-error=multichar']
 
-if CONFIG['MOZ_WEBRTC']:
-    XPCOM_MANIFESTS += [
-        'components.conf',
-    ]
-
-    EXTRA_JS_MODULES.media += [
-        'PeerConnection.jsm',
-    ]
+EXTRA_COMPONENTS += [
+    'PeerConnection.js',
+    'PeerConnection.manifest',
+]
 
 EXTRA_JS_MODULES.media += [
     'IdpSandbox.jsm',
     'PeerConnectionIdp.jsm',
     'RTCStatsReport.jsm',
 ]
 
 LOCAL_INCLUDES += [
--- a/dom/media/webspeech/synth/moz.build
+++ b/dom/media/webspeech/synth/moz.build
@@ -33,23 +33,20 @@ if CONFIG['MOZ_WEBSPEECH']:
         'nsSynthVoiceRegistry.cpp',
         'SpeechSynthesis.cpp',
         'SpeechSynthesisUtterance.cpp',
         'SpeechSynthesisVoice.cpp',
     ]
 
     if CONFIG['MOZ_WEBSPEECH_TEST_BACKEND']:
         UNIFIED_SOURCES += [
+            'test/FakeSynthModule.cpp',
             'test/nsFakeSynthServices.cpp'
         ]
 
-        XPCOM_MANIFESTS += [
-            'test/components.conf',
-        ]
-
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
         DIRS += ['windows']
 
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
         DIRS += ['cocoa']
 
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
         DIRS += ['android']
new file mode 100644
--- /dev/null
+++ b/dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "mozilla/ModuleUtils.h"
+#include "nsIClassInfoImpl.h"
+#include "SpeechDispatcherService.h"
+
+using namespace mozilla::dom;
+
+#define SPEECHDISPATCHERSERVICE_CID                  \
+  {                                                  \
+    0x8817b1cf, 0x5ada, 0x43bf, {                    \
+      0xbd, 0x73, 0x60, 0x76, 0x57, 0x70, 0x3d, 0x0d \
+    }                                                \
+  }
+
+#define SPEECHDISPATCHERSERVICE_CONTRACTID \
+  "@mozilla.org/synthspeechdispatcher;1"
+
+// Defines SpeechDispatcherServiceConstructor
+NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
+    SpeechDispatcherService, SpeechDispatcherService::GetInstanceForService)
+
+// Defines kSPEECHDISPATCHERSERVICE_CID
+NS_DEFINE_NAMED_CID(SPEECHDISPATCHERSERVICE_CID);
+
+static const mozilla::Module::CIDEntry kCIDs[] = {
+    {&kSPEECHDISPATCHERSERVICE_CID, true, nullptr,
+     SpeechDispatcherServiceConstructor},
+    {nullptr}};
+
+static const mozilla::Module::ContractIDEntry kContracts[] = {
+    {SPEECHDISPATCHERSERVICE_CONTRACTID, &kSPEECHDISPATCHERSERVICE_CID},
+    {nullptr}};
+
+static const mozilla::Module::CategoryEntry kCategories[] = {
+    {"speech-synth-started", "SpeechDispatcher Speech Synth",
+     SPEECHDISPATCHERSERVICE_CONTRACTID},
+    {nullptr}};
+
+static const mozilla::Module kModule = {
+    mozilla::Module::kVersion,
+    kCIDs,
+    kContracts,
+    kCategories,
+    nullptr,
+    nullptr,
+    nullptr,
+};
+
+NSMODULE_DEFN(synthspeechdispatcher) = &kModule;
deleted file mode 100644
--- a/dom/media/webspeech/synth/speechd/components.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{8817b1cf-5ada-43bf-bd73-607657703d0d}',
-        'contract_ids': ['@mozilla.org/synthspeechdispatcher;1'],
-        'singleton': True,
-        'type': 'mozilla::dom::SpeechDispatcherService',
-        'headers': ['/dom/media/webspeech/synth/speechd/SpeechDispatcherService.h'],
-        'constructor': 'mozilla::dom::SpeechDispatcherService::GetInstanceForService',
-        'categories': {"speech-synth-started": 'SpeechDispatcher Speech Synth'},
-    },
-]
--- a/dom/media/webspeech/synth/speechd/moz.build
+++ b/dom/media/webspeech/synth/speechd/moz.build
@@ -1,17 +1,13 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
+  'SpeechDispatcherModule.cpp',
   'SpeechDispatcherService.cpp'
 ]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
new file mode 100644
--- /dev/null
+++ b/dom/media/webspeech/synth/test/FakeSynthModule.cpp
@@ -0,0 +1,45 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "mozilla/ModuleUtils.h"
+#include "nsIClassInfoImpl.h"
+
+#include "nsFakeSynthServices.h"
+
+using namespace mozilla::dom;
+
+#define FAKESYNTHSERVICE_CID                         \
+  {                                                  \
+    0xe7d52d9e, 0xc148, 0x47d8, {                    \
+      0xab, 0x2a, 0x95, 0xd7, 0xf4, 0x0e, 0xa5, 0x3d \
+    }                                                \
+  }
+
+#define FAKESYNTHSERVICE_CONTRACTID "@mozilla.org/fakesynth;1"
+
+// Defines nsFakeSynthServicesConstructor
+NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
+    nsFakeSynthServices, nsFakeSynthServices::GetInstanceForService)
+
+// Defines kFAKESYNTHSERVICE_CID
+NS_DEFINE_NAMED_CID(FAKESYNTHSERVICE_CID);
+
+static const mozilla::Module::CIDEntry kCIDs[] = {
+    {&kFAKESYNTHSERVICE_CID, true, nullptr, nsFakeSynthServicesConstructor},
+    {nullptr}};
+
+static const mozilla::Module::ContractIDEntry kContracts[] = {
+    {FAKESYNTHSERVICE_CONTRACTID, &kFAKESYNTHSERVICE_CID}, {nullptr}};
+
+static const mozilla::Module::CategoryEntry kCategories[] = {
+    {"speech-synth-started", "Fake Speech Synth", FAKESYNTHSERVICE_CONTRACTID},
+    {nullptr}};
+
+static void UnloadFakeSynthmodule() { nsFakeSynthServices::Shutdown(); }
+
+static const mozilla::Module kModule = {
+    mozilla::Module::kVersion, kCIDs, kContracts, kCategories, nullptr, nullptr,
+    UnloadFakeSynthmodule};
+
+NSMODULE_DEFN(fakesynth) = &kModule;
deleted file mode 100644
--- a/dom/media/webspeech/synth/test/components.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{e7d52d9e-c148-47d8-ab2a-95d7f40ea53d}',
-        'contract_ids': ['@mozilla.org/fakesynth;1'],
-        'singleton': True,
-        'type': 'mozilla::dom::nsFakeSynthServices',
-        'headers': ['/dom/media/webspeech/synth/test/nsFakeSynthServices.h'],
-        'constructor': 'mozilla::dom::nsFakeSynthServices::GetInstanceForService',
-        'categories': {'speech-synth-started': 'Fake Speech Synth'},
-    },
-]
--- a/dom/media/webspeech/synth/test/nsFakeSynthServices.cpp
+++ b/dom/media/webspeech/synth/test/nsFakeSynthServices.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.h"
 #include "nsFakeSynthServices.h"
 #include "nsPrintfCString.h"
 #include "SharedBuffer.h"
 #include "nsISimpleEnumerator.h"
 
-#include "mozilla/ClearOnShutdown.h"
 #include "mozilla/dom/nsSynthVoiceRegistry.h"
 #include "mozilla/dom/nsSpeechTask.h"
 
 #include "nsThreadUtils.h"
 #include "prenv.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/DebugOnly.h"
 
@@ -269,22 +268,29 @@ nsFakeSynthServices* nsFakeSynthServices
   if (!XRE_IsParentProcess()) {
     MOZ_ASSERT(false,
                "nsFakeSynthServices can only be started on main gecko process");
     return nullptr;
   }
 
   if (!sSingleton) {
     sSingleton = new nsFakeSynthServices();
-    ClearOnShutdown(&sSingleton);
   }
 
   return sSingleton;
 }
 
 already_AddRefed<nsFakeSynthServices>
 nsFakeSynthServices::GetInstanceForService() {
   RefPtr<nsFakeSynthServices> picoService = GetInstance();
   return picoService.forget();
 }
 
+void nsFakeSynthServices::Shutdown() {
+  if (!sSingleton) {
+    return;
+  }
+
+  sSingleton = nullptr;
+}
+
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/media/webspeech/synth/test/nsFakeSynthServices.h
+++ b/dom/media/webspeech/synth/test/nsFakeSynthServices.h
@@ -24,16 +24,18 @@ class nsFakeSynthServices : public nsIOb
   NS_DECL_NSIOBSERVER
 
   nsFakeSynthServices() = default;
 
   static nsFakeSynthServices* GetInstance();
 
   static already_AddRefed<nsFakeSynthServices> GetInstanceForService();
 
+  static void Shutdown();
+
  private:
   virtual ~nsFakeSynthServices() = default;
 
   void Init();
 
   nsCOMPtr<nsISpeechService> mSynthService;
 
   static StaticRefPtr<nsFakeSynthServices> sSingleton;
rename from dom/notification/NotificationStorage.jsm
rename to dom/notification/NotificationStorage.js
--- a/dom/notification/NotificationStorage.jsm
+++ b/dom/notification/NotificationStorage.js
@@ -2,16 +2,21 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const DEBUG = false;
 function debug(s) { dump("-*- NotificationStorage.js: " + s + "\n"); }
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
+const NOTIFICATIONSTORAGE_CID = "{37f819b0-0b5c-11e3-8ffd-0800200c9a66}";
+const NOTIFICATIONSTORAGE_CONTRACTID = "@mozilla.org/notificationStorage;1";
+
 ChromeUtils.defineModuleGetter(this, "Services",
                                "resource://gre/modules/Services.jsm");
 
 const kMessageNotificationGetAllOk = "Notification:GetAll:Return:OK";
 const kMessageNotificationGetAllKo = "Notification:GetAll:Return:KO";
 const kMessageNotificationSaveKo   = "Notification:Save:Return:KO";
 const kMessageNotificationDeleteKo = "Notification:Delete:Return:KO";
 
@@ -181,13 +186,15 @@ NotificationStorage.prototype = {
     });
     try {
       Services.tm.dispatchToMainThread(callback.done);
     } catch (e) {
       if (DEBUG) { debug("Error calling callback done: " + e); }
     }
   },
 
+  classID : Components.ID(NOTIFICATIONSTORAGE_CID),
+  contractID : NOTIFICATIONSTORAGE_CONTRACTID,
   QueryInterface: ChromeUtils.generateQI([Ci.nsINotificationStorage]),
 };
 
 
-var EXPORTED_SYMBOLS = ["NotificationStorage"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NotificationStorage]);
new file mode 100644
--- /dev/null
+++ b/dom/notification/NotificationStorage.manifest
@@ -0,0 +1,3 @@
+# NotificationStorage.js
+component {37f819b0-0b5c-11e3-8ffd-0800200c9a66} NotificationStorage.js
+contract @mozilla.org/notificationStorage;1 {37f819b0-0b5c-11e3-8ffd-0800200c9a66}
deleted file mode 100644
--- a/dom/notification/components.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{37f819b0-0b5c-11e3-8ffd-0800200c9a66}',
-        'contract_ids': ['@mozilla.org/notificationStorage;1'],
-        'jsm': 'resource://gre/modules/NotificationStorage.jsm',
-        'constructor': 'NotificationStorage',
-    },
-]
--- a/dom/notification/moz.build
+++ b/dom/notification/moz.build
@@ -2,23 +2,23 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files("**"):
     BUG_COMPONENT = ("Toolkit", "Notifications and Alerts")
 
-EXTRA_JS_MODULES += [
-    'NotificationDB.jsm',
-    'NotificationStorage.jsm',
+EXTRA_COMPONENTS += [
+    'NotificationStorage.js',
+    'NotificationStorage.manifest',
 ]
 
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_JS_MODULES += [
+    'NotificationDB.jsm'
 ]
 
 EXPORTS.mozilla.dom += [
     'Notification.h',
     'NotificationEvent.h',
 ]
 
 UNIFIED_SOURCES += [
new file mode 100644
--- /dev/null
+++ b/dom/payments/PaymentRequestModule.cpp
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "mozilla/ModuleUtils.h"
+#include "PaymentActionResponse.h"
+#include "PaymentRequestData.h"
+#include "PaymentRequestService.h"
+
+using mozilla::dom::BasicCardMethodChangeDetails;
+using mozilla::dom::BasicCardResponseData;
+using mozilla::dom::GeneralMethodChangeDetails;
+using mozilla::dom::GeneralResponseData;
+using mozilla::dom::PaymentAbortActionResponse;
+using mozilla::dom::PaymentCanMakeActionResponse;
+using mozilla::dom::PaymentCompleteActionResponse;
+using mozilla::dom::PaymentRequestService;
+using mozilla::dom::PaymentShowActionResponse;
+using mozilla::dom::payments::PaymentAddress;
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(GeneralResponseData)
+NS_GENERIC_FACTORY_CONSTRUCTOR(BasicCardResponseData)
+NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentCanMakeActionResponse)
+NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentAbortActionResponse)
+NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentShowActionResponse)
+NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentCompleteActionResponse)
+NS_GENERIC_FACTORY_CONSTRUCTOR(GeneralMethodChangeDetails)
+NS_GENERIC_FACTORY_CONSTRUCTOR(BasicCardMethodChangeDetails)
+NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentAddress)
+NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(PaymentRequestService,
+                                         PaymentRequestService::GetSingleton)
+
+NS_DEFINE_NAMED_CID(NS_GENERAL_RESPONSE_DATA_CID);
+NS_DEFINE_NAMED_CID(NS_BASICCARD_RESPONSE_DATA_CID);
+NS_DEFINE_NAMED_CID(NS_PAYMENT_CANMAKE_ACTION_RESPONSE_CID);
+NS_DEFINE_NAMED_CID(NS_PAYMENT_ABORT_ACTION_RESPONSE_CID);
+NS_DEFINE_NAMED_CID(NS_PAYMENT_SHOW_ACTION_RESPONSE_CID);
+NS_DEFINE_NAMED_CID(NS_PAYMENT_COMPLETE_ACTION_RESPONSE_CID);
+NS_DEFINE_NAMED_CID(NS_GENERAL_CHANGE_DETAILS_CID);
+NS_DEFINE_NAMED_CID(NS_BASICCARD_CHANGE_DETAILS_CID);
+NS_DEFINE_NAMED_CID(NS_PAYMENT_ADDRESS_CID);
+NS_DEFINE_NAMED_CID(NS_PAYMENT_REQUEST_SERVICE_CID);
+
+static const mozilla::Module::CIDEntry kPaymentRequestCIDs[] = {
+    {&kNS_GENERAL_RESPONSE_DATA_CID, false, nullptr,
+     GeneralResponseDataConstructor},
+    {&kNS_BASICCARD_RESPONSE_DATA_CID, false, nullptr,
+     BasicCardResponseDataConstructor},
+    {&kNS_PAYMENT_CANMAKE_ACTION_RESPONSE_CID, false, nullptr,
+     PaymentCanMakeActionResponseConstructor},
+    {&kNS_PAYMENT_ABORT_ACTION_RESPONSE_CID, false, nullptr,
+     PaymentAbortActionResponseConstructor},
+    {&kNS_PAYMENT_SHOW_ACTION_RESPONSE_CID, false, nullptr,
+     PaymentShowActionResponseConstructor},
+    {&kNS_PAYMENT_COMPLETE_ACTION_RESPONSE_CID, false, nullptr,
+     PaymentCompleteActionResponseConstructor},
+    {&kNS_GENERAL_CHANGE_DETAILS_CID, false, nullptr,
+     GeneralMethodChangeDetailsConstructor},
+    {&kNS_BASICCARD_CHANGE_DETAILS_CID, false, nullptr,
+     BasicCardMethodChangeDetailsConstructor},
+    {&kNS_PAYMENT_ADDRESS_CID, false, nullptr, PaymentAddressConstructor},
+    {&kNS_PAYMENT_REQUEST_SERVICE_CID, true, nullptr,
+     PaymentRequestServiceConstructor},
+    {nullptr}};
+
+static const mozilla::Module::ContractIDEntry kPaymentRequestContracts[] = {
+    {NS_GENERAL_RESPONSE_DATA_CONTRACT_ID, &kNS_GENERAL_RESPONSE_DATA_CID},
+    {NS_BASICCARD_RESPONSE_DATA_CONTRACT_ID, &kNS_BASICCARD_RESPONSE_DATA_CID},
+    {NS_PAYMENT_CANMAKE_ACTION_RESPONSE_CONTRACT_ID,
+     &kNS_PAYMENT_CANMAKE_ACTION_RESPONSE_CID},
+    {NS_PAYMENT_ABORT_ACTION_RESPONSE_CONTRACT_ID,
+     &kNS_PAYMENT_ABORT_ACTION_RESPONSE_CID},
+    {NS_PAYMENT_SHOW_ACTION_RESPONSE_CONTRACT_ID,
+     &kNS_PAYMENT_SHOW_ACTION_RESPONSE_CID},
+    {NS_PAYMENT_COMPLETE_ACTION_RESPONSE_CONTRACT_ID,
+     &kNS_PAYMENT_COMPLETE_ACTION_RESPONSE_CID},
+    {NS_GENERAL_CHANGE_DETAILS_CONTRACT_ID, &kNS_GENERAL_CHANGE_DETAILS_CID},
+    {NS_BASICCARD_CHANGE_DETAILS_CONTRACT_ID,
+     &kNS_BASICCARD_CHANGE_DETAILS_CID},
+    {NS_PAYMENT_ADDRESS_CONTRACT_ID, &kNS_PAYMENT_ADDRESS_CID},
+    {NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID, &kNS_PAYMENT_REQUEST_SERVICE_CID},
+    {nullptr}};
+
+static const mozilla::Module::CategoryEntry kPaymentRequestCategories[] = {
+    {"payment-request", "GeneralResponseData",
+     NS_GENERAL_RESPONSE_DATA_CONTRACT_ID},
+    {"payment-request", "BasicCardResponseData",
+     NS_BASICCARD_RESPONSE_DATA_CONTRACT_ID},
+    {"payment-request", "PaymentCanMakeActionResponse",
+     NS_PAYMENT_CANMAKE_ACTION_RESPONSE_CONTRACT_ID},
+    {"payment-request", "PaymentAbortActionResponse",
+     NS_PAYMENT_ABORT_ACTION_RESPONSE_CONTRACT_ID},
+    {"payment-request", "PaymentShowActionResponse",
+     NS_PAYMENT_SHOW_ACTION_RESPONSE_CONTRACT_ID},
+    {"payment-request", "PaymentCompleteActionResponse",
+     NS_PAYMENT_COMPLETE_ACTION_RESPONSE_CONTRACT_ID},
+    {"payment-request", "GeneralMethodChangeDetails",
+     NS_GENERAL_CHANGE_DETAILS_CONTRACT_ID},
+    {"payment-request", "BasicCardMethodChangeDetails",
+     NS_BASICCARD_CHANGE_DETAILS_CONTRACT_ID},
+    {"payment-request", "PaymentAddress", NS_PAYMENT_ADDRESS_CONTRACT_ID},
+    {"payment-request", "PaymentRequestService",
+     NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID},
+    {nullptr}};
+
+static const mozilla::Module kPaymentRequestModule = {
+    mozilla::Module::kVersion, kPaymentRequestCIDs, kPaymentRequestContracts,
+    kPaymentRequestCategories};
+
+NSMODULE_DEFN(PaymentRequestModule) = &kPaymentRequestModule;
deleted file mode 100644
--- a/dom/payments/components.conf
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{5296f79e-15ea-40c3-8196-19cfa64d328c}',
-        'contract_ids': ['@mozilla.org/dom/payments/basiccard-change-details;1'],
-        'type': 'mozilla::dom::BasicCardMethodChangeDetails',
-        'headers': ['/dom/payments/PaymentActionResponse.h'],
-        'categories': {'payment-request': 'BasicCardMethodChangeDetails'},
-    },
-    {
-        'cid': '{0d55a5e6-d185-44f0-b992-a8e1321e4bce}',
-        'contract_ids': ['@mozilla.org/dom/payments/basiccard-response-data;1'],
-        'type': 'mozilla::dom::BasicCardResponseData',
-        'headers': ['/dom/payments/PaymentActionResponse.h'],
-        'categories': {'payment-request': 'BasicCardResponseData'},
-    },
-    {
-        'cid': '{e031267e-bec8-4f3c-b0b1-396b77ca260c}',
-        'contract_ids': ['@mozilla.org/dom/payments/general-change-details;1'],
-        'type': 'mozilla::dom::GeneralMethodChangeDetails',
-        'headers': ['/dom/payments/PaymentActionResponse.h'],
-        'categories': {'payment-request': 'GeneralMethodChangeDetails'},
-    },
-    {
-        'cid': '{b986773e-2b30-4ed2-b8fe-6a96631c8000}',
-        'contract_ids': ['@mozilla.org/dom/payments/general-response-data;1'],
-        'type': 'mozilla::dom::GeneralResponseData',
-        'headers': ['/dom/payments/PaymentActionResponse.h'],
-        'categories': {'payment-request': 'GeneralResponseData'},
-    },
-    {
-        'cid': '{8c72bcdb-0c37-4786-a9e5-510afa2f8ede}',
-        'contract_ids': ['@mozilla.org/dom/payments/payment-abort-action-response;1'],
-        'type': 'mozilla::dom::PaymentAbortActionResponse',
-        'headers': ['/dom/payments/PaymentActionResponse.h'],
-        'categories': {'payment-request': 'PaymentAbortActionResponse'},
-    },
-    {
-        'cid': '{49a02241-7e48-477a-9345-9f246925dcb3}',
-        'contract_ids': ['@mozilla.org/dom/payments/payment-address;1'],
-        'type': 'mozilla::dom::payments::PaymentAddress',
-        'headers': ['PaymentRequestData.h'],
-        'categories': {'payment-request': 'PaymentAddress'},
-    },
-    {
-        'cid': '{52fc3f9f-c0cb-4874-b3d4-ee4b6e9cbe9c}',
-        'contract_ids': ['@mozilla.org/dom/payments/payment-canmake-action-response;1'],
-        'type': 'mozilla::dom::PaymentCanMakeActionResponse',
-        'headers': ['/dom/payments/PaymentActionResponse.h'],
-        'categories': {'payment-request': 'PaymentCanMakeActionResponse'},
-    },
-    {
-        'cid': '{62c01e69-9ca4-4060-99e4-b95f628c8e6d}',
-        'contract_ids': ['@mozilla.org/dom/payments/payment-complete-action-response;1'],
-        'type': 'mozilla::dom::PaymentCompleteActionResponse',
-        'headers': ['/dom/payments/PaymentActionResponse.h'],
-        'categories': {'payment-request': 'PaymentCompleteActionResponse'},
-    },
-    {
-        'cid': '{cccd665f-edf3-41fc-ab9b-fc55b37340aa}',
-        'contract_ids': ['@mozilla.org/dom/payments/payment-request-service;1'],
-        'singleton': True,
-        'type': 'mozilla::dom::PaymentRequestService',
-        'headers': ['PaymentRequestService.h'],
-        'constructor': 'mozilla::dom::PaymentRequestService::GetSingleton',
-        'categories': {'payment-request': 'PaymentRequestService'},
-    },
-    {
-        'cid': '{184385cb-2d35-4b99-a9a3-7c780bf66b9b}',
-        'contract_ids': ['@mozilla.org/dom/payments/payment-show-action-response;1'],
-        'type': 'mozilla::dom::PaymentShowActionResponse',
-        'headers': ['/dom/payments/PaymentActionResponse.h'],
-        'categories': {'payment-request': 'PaymentShowActionResponse'},
-    },
-]
--- a/dom/payments/moz.build
+++ b/dom/payments/moz.build
@@ -27,26 +27,23 @@ UNIFIED_SOURCES += [
     'BasicCardPayment.cpp',
     'MerchantValidationEvent.cpp',
     'PaymentActionResponse.cpp',
     'PaymentAddress.cpp',
     'PaymentMethodChangeEvent.cpp',
     'PaymentRequest.cpp',
     'PaymentRequestData.cpp',
     'PaymentRequestManager.cpp',
+    'PaymentRequestModule.cpp',
     'PaymentRequestService.cpp',
     'PaymentRequestUpdateEvent.cpp',
     'PaymentRequestUtils.cpp',
     'PaymentResponse.cpp',
 ]
 
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM: Web Payments")
 
 BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
deleted file mode 100644
--- a/dom/plugins/base/components.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{23e8fd98-a625-4b08-be1a-f7cc18a5b106}',
-        'contract_ids': ['@mozilla.org/plugin/host;1'],
-        'singleton': True,
-        'type': 'nsPluginHost',
-        'headers': ['nsPluginHost.h'],
-        'constructor': 'nsPluginHost::GetInst',
-    },
-]
--- a/dom/plugins/base/moz.build
+++ b/dom/plugins/base/moz.build
@@ -33,16 +33,17 @@ EXPORTS += [
     'nsPluginTags.h',
 ]
 
 UNIFIED_SOURCES += [
     'nsJSNPRuntime.cpp',
     'nsNPAPIPluginInstance.cpp',
     'nsNPAPIPluginStreamListener.cpp',
     'nsPluginInstanceOwner.cpp',
+    'nsPluginModule.cpp',
     'nsPluginStreamListenerPeer.cpp',
     'nsPluginTags.cpp',
 ]
 
 SOURCES += [
     'nsNPAPIPlugin.cpp', # Conflict with X11 headers
     'nsPluginHost.cpp',  # Conflict with NS_NPAPIPLUGIN_CALLBACK
 ]
@@ -61,20 +62,16 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
         'nsPluginsDirDarwin.cpp', # conflict with mozilla::EventPriority
     ]
 else:
     UNIFIED_SOURCES += [
         'nsPluginNativeWindow.cpp',
         'nsPluginsDirUnix.cpp',
     ]
 
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/plugins/ipc',
     '/layout/generic',
     '/layout/xul',
     '/netwerk/base',
     '/widget',
     '/widget/cocoa',
new file mode 100644
--- /dev/null
+++ b/dom/plugins/base/nsPluginModule.cpp
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "mozilla/ModuleUtils.h"
+#include "nsPluginHost.h"
+#include "nsPluginsCID.h"
+
+NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPluginHost, nsPluginHost::GetInst)
+NS_DEFINE_NAMED_CID(NS_PLUGIN_HOST_CID);
+
+static const mozilla::Module::CIDEntry kPluginCIDs[] = {
+    {&kNS_PLUGIN_HOST_CID, false, nullptr, nsPluginHostConstructor}, {nullptr}};
+
+static const mozilla::Module::ContractIDEntry kPluginContracts[] = {
+    {MOZ_PLUGIN_HOST_CONTRACTID, &kNS_PLUGIN_HOST_CID}, {nullptr}};
+
+static const mozilla::Module kPluginModule = {mozilla::Module::kVersion,
+                                              kPluginCIDs, kPluginContracts};
+
+NSMODULE_DEFN(nsPluginModule) = &kPluginModule;
rename from dom/presentation/PresentationDataChannelSessionTransport.jsm
rename to dom/presentation/PresentationDataChannelSessionTransport.js
--- a/dom/presentation/PresentationDataChannelSessionTransport.jsm
+++ b/dom/presentation/PresentationDataChannelSessionTransport.js
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // Bug 1228209 - plan to remove this eventually
 function log(aMsg) {
   // dump("-*- PresentationDataChannelSessionTransport.js : " + aMsg + "\n");
 }
 
 const PRESENTATIONTRANSPORT_CID = Components.ID("{dd2bbf2f-3399-4389-8f5f-d382afb8b2d6}");
@@ -366,9 +367,10 @@ PresentationTransport.prototype = {
       });
       reader.readAsBinaryString(aData);
     } else {
       this._callback.notifyData(aData, false);
     }
   },
 };
 
-var EXPORTED_SYMBOLS = ["PresentationTransportBuilder", "PresentationTransport"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationTransportBuilder,
+                                                     PresentationTransport]);
new file mode 100644
--- /dev/null
+++ b/dom/presentation/PresentationDataChannelSessionTransport.manifest
@@ -0,0 +1,6 @@
+# PresentationDataChannelSessionTransport.js
+component {dd2bbf2f-3399-4389-8f5f-d382afb8b2d6} PresentationDataChannelSessionTransport.js
+contract @mozilla.org/presentation/datachanneltransport;1 {dd2bbf2f-3399-4389-8f5f-d382afb8b2d6}
+
+component {215b2f62-46e2-4004-a3d1-6858e56c20f3} PresentationDataChannelSessionTransport.js
+contract @mozilla.org/presentation/datachanneltransportbuilder;1 {215b2f62-46e2-4004-a3d1-6858e56c20f3}
rename from dom/presentation/PresentationNetworkHelper.jsm
rename to dom/presentation/PresentationNetworkHelper.js
--- a/dom/presentation/PresentationNetworkHelper.jsm
+++ b/dom/presentation/PresentationNetworkHelper.js
@@ -1,22 +1,26 @@
 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {EventDispatcher} = ChromeUtils.import("resource://gre/modules/Messaging.jsm");
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
+const NETWORKHELPER_CID = Components.ID("{5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d}");
 
 function PresentationNetworkHelper() {}
 
 PresentationNetworkHelper.prototype = {
+  classID: NETWORKHELPER_CID,
   QueryInterface: ChromeUtils.generateQI([Ci.nsIPresentationNetworkHelper]),
 
   getWifiIPAddress(aListener) {
     EventDispatcher.instance.sendRequestForResult({type: "Wifi:GetIPAddress"})
              .then(result => aListener.onGetWifiIPAddress(result),
                    err => aListener.onError(err));
   },
 };
 
-var EXPORTED_SYMBOLS = ["PresentationNetworkHelper"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationNetworkHelper]);
new file mode 100644
--- /dev/null
+++ b/dom/presentation/PresentationNetworkHelper.manifest
@@ -0,0 +1,3 @@
+# PresentationNetworkHelper.js
+component {5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d} PresentationNetworkHelper.js
+contract @mozilla.org/presentation-device/networkHelper;1 {5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d}
deleted file mode 100644
--- a/dom/presentation/components.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{dd2bbf2f-3399-4389-8f5f-d382afb8b2d6}',
-        'contract_ids': ['@mozilla.org/presentation/datachanneltransport;1'],
-        'jsm': 'resource://gre/modules/PresentationDataChannelSessionTransport.jsm',
-        'constructor': 'PresentationTransport',
-    },
-    {
-        'cid': '{215b2f62-46e2-4004-a3d1-6858e56c20f3}',
-        'contract_ids': ['@mozilla.org/presentation/datachanneltransportbuilder;1'],
-        'jsm': 'resource://gre/modules/PresentationDataChannelSessionTransport.jsm',
-        'constructor': 'PresentationTransportBuilder',
-    },
-]
-
-if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android':
-    Classes += [
-        {
-            'cid': '{5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d}',
-            'contract_ids': ['@mozilla.org/presentation-device/networkHelper;1'],
-            'jsm': 'resource://gre/modules/PresentationNetworkHelper.jsm',
-            'constructor': 'PresentationNetworkHelper',
-        },
-    ]
--- a/dom/presentation/moz.build
+++ b/dom/presentation/moz.build
@@ -55,27 +55,25 @@ UNIFIED_SOURCES += [
     'PresentationService.cpp',
     'PresentationSessionInfo.cpp',
     'PresentationSessionRequest.cpp',
     'PresentationTCPSessionTransport.cpp',
     'PresentationTerminateRequest.cpp',
     'PresentationTransportBuilderConstructor.cpp'
 ]
 
-EXTRA_JS_MODULES += [
-    'PresentationDataChannelSessionTransport.jsm',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
+EXTRA_COMPONENTS += [
+    'PresentationDataChannelSessionTransport.js',
+    'PresentationDataChannelSessionTransport.manifest',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
-    EXTRA_JS_MODULES += [
-        'PresentationNetworkHelper.jsm',
+    EXTRA_COMPONENTS += [
+        'PresentationNetworkHelper.js',
+        'PresentationNetworkHelper.manifest',
     ]
 
 IPDL_SOURCES += [
     'ipc/PPresentation.ipdl',
     'ipc/PPresentationBuilder.ipdl',
     'ipc/PPresentationRequest.ipdl'
 ]
 
rename from dom/presentation/provider/AndroidCastDeviceProvider.jsm
rename to dom/presentation/provider/AndroidCastDeviceProvider.js
--- a/dom/presentation/provider/AndroidCastDeviceProvider.jsm
+++ b/dom/presentation/provider/AndroidCastDeviceProvider.js
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {EventDispatcher} = ChromeUtils.import("resource://gre/modules/Messaging.jsm");
 
 function log(str) {
   // dump("-*- AndroidCastDeviceProvider -*-: " + str + "\n");
 }
 
 // Helper function: transfer nsIPresentationChannelDescription to json
@@ -454,9 +455,9 @@ AndroidCastDeviceProvider.prototype = {
     }
   },
 
   classID: Components.ID("{7394f24c-dbc3-48c8-8a47-cd10169b7c6b}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsIPresentationDeviceProvider]),
 };
 
-var EXPORTED_SYMBOLS = ["AndroidCastDeviceProvider"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AndroidCastDeviceProvider]);
new file mode 100644
--- /dev/null
+++ b/dom/presentation/provider/AndroidCastDeviceProvider.manifest
@@ -0,0 +1,4 @@
+# AndroidCastDeviceProvider.js
+component {7394f24c-dbc3-48c8-8a47-cd10169b7c6b} AndroidCastDeviceProvider.js
+contract @mozilla.org/presentation-device/android-cast-device-provider;1 {7394f24c-dbc3-48c8-8a47-cd10169b7c6b}
+category presentation-device-provider AndroidCastDeviceProvider @mozilla.org/presentation-device/android-cast-device-provider;1
new file mode 100644
--- /dev/null
+++ b/dom/presentation/provider/BuiltinProviders.manifest
@@ -0,0 +1,2 @@
+component {f4079b8b-ede5-4b90-a112-5b415a931deb} PresentationControlService.js
+contract @mozilla.org/presentation/control-service;1 {f4079b8b-ede5-4b90-a112-5b415a931deb}
rename from dom/presentation/provider/PresentationControlService.jsm
rename to dom/presentation/provider/PresentationControlService.js
--- a/dom/presentation/provider/PresentationControlService.jsm
+++ b/dom/presentation/provider/PresentationControlService.js
@@ -1,13 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 const {clearTimeout, setTimeout} = ChromeUtils.import("resource://gre/modules/Timer.jsm");
 
 ChromeUtils.defineModuleGetter(this, "ControllerStateMachine",
                                "resource://gre/modules/presentation/ControllerStateMachine.jsm");
 ChromeUtils.defineModuleGetter(this, "ReceiverStateMachine",
                                "resource://gre/modules/presentation/ReceiverStateMachine.jsm");
@@ -941,9 +942,9 @@ TCPControlChannel.prototype = {
     this._listener.onIceCandidate(candidate);
   },
 
   classID: Components.ID("{fefb8286-0bdc-488b-98bf-0c11b485c955}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIPresentationControlChannel,
                                           Ci.nsIStreamListener]),
 };
 
-var EXPORTED_SYMBOLS = ["PresentationControlService"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationControlService]); // jshint ignore:line
new file mode 100644
--- /dev/null
+++ b/dom/presentation/provider/PresentationDeviceProviderModule.cpp
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "MulticastDNSDeviceProvider.h"
+#include "mozilla/ModuleUtils.h"
+
+#define MULTICAST_DNS_PROVIDER_CID                   \
+  {                                                  \
+    0x814f947a, 0x52f7, 0x41c9, {                    \
+      0x94, 0xa1, 0x36, 0x84, 0x79, 0x72, 0x84, 0xac \
+    }                                                \
+  }
+
+#define MULTICAST_DNS_PROVIDER_CONTRACT_ID \
+  "@mozilla.org/presentation-device/multicastdns-provider;1"
+
+using mozilla::dom::presentation::MulticastDNSDeviceProvider;
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(MulticastDNSDeviceProvider)
+NS_DEFINE_NAMED_CID(MULTICAST_DNS_PROVIDER_CID);
+
+static const mozilla::Module::CIDEntry kPresentationDeviceProviderCIDs[] = {
+    {&kMULTICAST_DNS_PROVIDER_CID, false, nullptr,
+     MulticastDNSDeviceProviderConstructor},
+    {nullptr}};
+
+static const mozilla::Module::ContractIDEntry
+    kPresentationDeviceProviderContracts[] = {
+        {MULTICAST_DNS_PROVIDER_CONTRACT_ID, &kMULTICAST_DNS_PROVIDER_CID},
+        {nullptr}};
+
+static const mozilla::Module::CategoryEntry
+    kPresentationDeviceProviderCategories[] = {
+#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID)
+        {PRESENTATION_DEVICE_PROVIDER_CATEGORY, "MulticastDNSDeviceProvider",
+         MULTICAST_DNS_PROVIDER_CONTRACT_ID},
+#endif
+        {nullptr}};
+
+static const mozilla::Module kPresentationDeviceProviderModule = {
+    mozilla::Module::kVersion, kPresentationDeviceProviderCIDs,
+    kPresentationDeviceProviderContracts,
+    kPresentationDeviceProviderCategories};
+
+NSMODULE_DEFN(PresentationDeviceProviderModule) =
+    &kPresentationDeviceProviderModule;
deleted file mode 100644
--- a/dom/presentation/provider/components.conf
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-categories = {}
-
-if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'android'):
-    categories["presentation-device-provider"] = "MulticastDNSDeviceProvider"
-
-Classes = [
-    {
-        'cid': '{814f947a-52f7-41c9-94a1-3684797284ac}',
-        'contract_ids': ['@mozilla.org/presentation-device/multicastdns-provider;1'],
-        'type': 'mozilla::dom::presentation::MulticastDNSDeviceProvider',
-        'headers': ['/dom/presentation/provider/MulticastDNSDeviceProvider.h'],
-        'categories': categories,
-    },
-    {
-        'cid': '{f4079b8b-ede5-4b90-a112-5b415a931deb}',
-        'contract_ids': ['@mozilla.org/presentation/control-service;1'],
-        'jsm': 'resource://gre/modules/PresentationControlService.jsm',
-        'constructor': 'PresentationControlService',
-    },
-]
-
-if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android':
-    Classes += [
-        {
-            'cid': '{7394f24c-dbc3-48c8-8a47-cd10169b7c6b}',
-            'contract_ids': ['@mozilla.org/presentation-device/android-cast-device-provider;1'],
-            'jsm': 'resource://gre/modules/AndroidCastDeviceProvider.jsm',
-            'constructor': 'AndroidCastDeviceProvider',
-            'categories': {'presentation-device-provider': 'AndroidCastDeviceProvider'},
-        },
-    ]
--- a/dom/presentation/provider/moz.build
+++ b/dom/presentation/provider/moz.build
@@ -1,33 +1,32 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXTRA_JS_MODULES += [
-    'PresentationControlService.jsm'
+EXTRA_COMPONENTS += [
+    'BuiltinProviders.manifest',
+    'PresentationControlService.js'
 ]
 
 UNIFIED_SOURCES += [
     'DeviceProviderHelpers.cpp',
     'MulticastDNSDeviceProvider.cpp',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
+    'PresentationDeviceProviderModule.cpp',
 ]
 
 EXTRA_JS_MODULES.presentation += [
     'ControllerStateMachine.jsm',
     'ReceiverStateMachine.jsm',
     'StateMachineHelper.jsm',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
-    EXTRA_JS_MODULES += [
+    EXTRA_COMPONENTS += [
         # For android presentation device
-        'AndroidCastDeviceProvider.jsm',
+        'AndroidCastDeviceProvider.js',
+        'AndroidCastDeviceProvider.manifest',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 FINAL_LIBRARY = 'xul'
--- a/dom/presentation/tests/mochitest/PresentationSessionFrameScript.js
+++ b/dom/presentation/tests/mochitest/PresentationSessionFrameScript.js
@@ -180,31 +180,34 @@ function loadPrivilegedScriptTest() {
     if (!registrar.isCIDRegistered(mockedClassId)) {
       try {
         originalClassId = registrar.contractIDToCID(contractId);
         originalFactory = Cm.getClassObject(Cc[contractId], Ci.nsIFactory);
       } catch (ex) {
         originalClassId = "";
         originalFactory = null;
       }
+      if (originalFactory) {
+        registrar.unregisterFactory(originalClassId, originalFactory);
+      }
       registrar.registerFactory(mockedClassId, "", contractId, mockedFactory);
     }
 
     return { contractId,
              mockedClassId,
              mockedFactory,
              originalClassId,
              originalFactory };
   }
 
   function registerOriginalFactory(contractId, mockedClassId, mockedFactory, originalClassId, originalFactory) {
     if (originalFactory) {
       var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
       registrar.unregisterFactory(mockedClassId, mockedFactory);
-      registrar.registerFactory(originalClassId, "", contractId, null);
+      registrar.registerFactory(originalClassId, "", contractId, originalFactory);
     }
   }
 
   /* Register mocked factories. */
   const originalFactoryData = [];
   const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
                         .getService(Ci.nsIUUIDGenerator);
   originalFactoryData.push(registerMockedFactory("@mozilla.org/presentation/datachanneltransportbuilder;1",
--- a/dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js
+++ b/dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js
@@ -95,17 +95,17 @@ ContractHook.prototype = {
   reset() {},
 
   cleanup() {
     this.reset();
 
     this.unregister();
     let prevContract = this.hookedMap.get(this._contractID).pop();
 
-    if (prevContract.classID) {
+    if (prevContract.factory) {
       registrar.registerFactory(prevContract.classID,
                                 "",
                                 this._contractID,
                                 prevContract.factory);
     }
   },
 
   unregister() {
@@ -115,21 +115,17 @@ ContractHook.prototype = {
       classID = registrar.contractIDToCID(this._contractID);
       factory = Cm.getClassObject(Cc[this._contractID], Ci.nsIFactory);
     } catch (ex) {
       classID = "";
       factory = null;
     }
 
     if (factory) {
-      try {
-        registrar.unregisterFactory(classID, factory);
-      } catch (e) {
-        factory = null;
-      }
+      registrar.unregisterFactory(classID, factory);
     }
 
     return { classID, factory };
   },
 };
 
 function MockDNSServiceInfo() {}
 MockDNSServiceInfo.prototype = {
rename from dom/push/Push.jsm
rename to dom/push/Push.js
--- a/dom/push/Push.jsm
+++ b/dom/push/Push.js
@@ -280,9 +280,9 @@ PushSubscriptionCallback.prototype = {
           "Error retrieving push subscription.",
           "AbortError"
         );
     }
     this.reject(error);
   },
 };
 
-var EXPORTED_SYMBOLS = ["Push"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Push]);
--- a/dom/push/Push.manifest
+++ b/dom/push/Push.manifest
@@ -1,4 +1,11 @@
+# DOM API
+component {cde1d019-fad8-4044-b141-65fb4fb7a245} Push.js
+contract @mozilla.org/push/PushManager;1 {cde1d019-fad8-4044-b141-65fb4fb7a245}
+
+# XPCOM components.
+component {daaa8d73-677e-4233-8acd-2c404bd01658} PushComponents.js
+contract @mozilla.org/push/Service;1 {daaa8d73-677e-4233-8acd-2c404bd01658}
 category app-startup PushServiceParent @mozilla.org/push/Service;1 process=main
 
 # For immediate loading of PushService instead of delayed loading.
 category android-push-service PushServiceParent @mozilla.org/push/Service;1 process=main
rename from dom/push/PushComponents.jsm
rename to dom/push/PushComponents.js
--- a/dom/push/PushComponents.jsm
+++ b/dom/push/PushComponents.js
@@ -108,32 +108,28 @@ PushServiceBase.prototype = {
   },
 };
 
 /**
  * The parent process implementation of `nsIPushService`. This version loads
  * `PushService.jsm` at startup and calls its methods directly. It also
  * receives and responds to requests from the content process.
  */
-let parentInstance;
 function PushServiceParent() {
-  if (parentInstance) {
-    return parentInstance;
-  }
-  parentInstance = this;
-
   PushServiceBase.call(this);
 }
 
 PushServiceParent.prototype = Object.create(PushServiceBase.prototype);
 
 XPCOMUtils.defineLazyServiceGetter(PushServiceParent.prototype, "_mm",
   "@mozilla.org/parentprocessmessagemanager;1", "nsISupports");
 
 Object.assign(PushServiceParent.prototype, {
+  _xpcom_factory: XPCOMUtils.generateSingletonFactory(PushServiceParent),
+
   _messages: [
     "Push:Register",
     "Push:Registration",
     "Push:Unregister",
     "Push:Clear",
     "Push:NotificationForOriginShown",
     "Push:NotificationForOriginClosed",
     "Push:ReportError",
@@ -305,41 +301,37 @@ Object.defineProperty(PushServiceParent.
   get() {
     return this._service || PushService;
   },
   set(impl) {
     this._service = impl;
   },
 });
 
-let contentInstance;
 /**
  * The content process implementation of `nsIPushService`. This version
  * uses the child message manager to forward calls to the parent process.
  * The parent Push service instance handles the request, and responds with a
  * message containing the result.
  */
 function PushServiceContent() {
-  if (contentInstance) {
-    return contentInstance;
-  }
-  contentInstance = this;
-
   PushServiceBase.apply(this, arguments);
   this._requests = new Map();
   this._requestId = 0;
 }
 
 PushServiceContent.prototype = Object.create(PushServiceBase.prototype);
 
 XPCOMUtils.defineLazyServiceGetter(PushServiceContent.prototype,
   "_mm", "@mozilla.org/childprocessmessagemanager;1",
   "nsISupports");
 
 Object.assign(PushServiceContent.prototype, {
+  _xpcom_factory: XPCOMUtils.generateSingletonFactory(PushServiceContent),
+
   _messages: [
     "PushService:Register:OK",
     "PushService:Register:KO",
     "PushService:Registration:OK",
     "PushService:Registration:KO",
     "PushService:Unregister:OK",
     "PushService:Unregister:KO",
     "PushService:Clear:OK",
@@ -551,13 +543,13 @@ PushSubscription.prototype = {
     let rawKey = new Uint8Array(key);
     if (outKeyLen) {
       outKeyLen.value = rawKey.length;
     }
     return rawKey;
   },
 };
 
-// Export the correct implementation depending on whether we're running in
-// the parent or content process.
-let Service = isParent ? PushServiceParent : PushServiceContent;
-
-var EXPORTED_SYMBOLS = ["Service"];
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
+  // Export the correct implementation depending on whether we're running in
+  // the parent or content process.
+  isParent ? PushServiceParent : PushServiceContent,
+]);
deleted file mode 100644
--- a/dom/push/components.conf
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{cde1d019-fad8-4044-b141-65fb4fb7a245}',
-        'contract_ids': ['@mozilla.org/push/PushManager;1'],
-        'jsm': 'resource://gre/modules/Push.jsm',
-        'constructor': 'Push',
-    },
-    {