diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 6f65bed845fa..4ad54f1315c2 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -243,8 +243,6 @@ @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 diff --git a/dom/browser-element/BrowserElementPromptService.jsm b/dom/browser-element/BrowserElementPromptService.jsm index f99f6b543207..9a42729c3f72 100644 --- a/dom/browser-element/BrowserElementPromptService.jsm +++ b/dom/browser-element/BrowserElementPromptService.jsm @@ -596,8 +596,6 @@ var BrowserElementPromptService = { return; } - Cm.unregisterFactory(oldCID, oldFactory); - var oldInstance = oldFactory.createInstance(null, Ci.nsIPromptFactory); var newInstance = new BrowserElementPromptFactory(oldInstance); diff --git a/toolkit/components/prompts/src/nsPrompter.js b/toolkit/components/prompts/src/Prompter.jsm similarity index 99% rename from toolkit/components/prompts/src/nsPrompter.js rename to toolkit/components/prompts/src/Prompter.jsm index f2e29c1931b4..ff9ba4ec373d 100644 --- a/toolkit/components/prompts/src/nsPrompter.js +++ b/toolkit/components/prompts/src/Prompter.jsm @@ -940,5 +940,4 @@ function EmbedPrompter() { EmbedPrompter.prototype = new Prompter(); EmbedPrompter.prototype.classID = Components.ID("{7ad1b327-6dfa-46ec-9234-f2a620ea7e00}"); -var component = [Prompter, EmbedPrompter, AuthPromptAdapterFactory]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var EXPORTED_SYMBOLS = ["Prompter", "EmbedPrompter", "AuthPromptAdapterFactory"]; diff --git a/toolkit/components/prompts/src/components.conf b/toolkit/components/prompts/src/components.conf new file mode 100644 index 000000000000..d6861586c802 --- /dev/null +++ b/toolkit/components/prompts/src/components.conf @@ -0,0 +1,26 @@ +# -*- 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': '{1c978d25-b37f-43a8-a2d6-0c7a239ead87}', + 'contract_ids': ['@mozilla.org/prompter;1'], + 'jsm': 'resource://gre/modules/Prompter.jsm', + 'constructor': 'Prompter', + }, + { + 'cid': '{6e134924-6c3a-4d86-81ac-69432dd971dc}', + 'contract_ids': ['@mozilla.org/network/authprompt-adapter-factory;1'], + 'jsm': 'resource://gre/modules/Prompter.jsm', + 'constructor': 'AuthPromptAdapterFactory', + }, + { + 'cid': '{7ad1b327-6dfa-46ec-9234-f2a620ea7e00}', + 'contract_ids': ['@mozilla.org/embedcomp/prompt-service;1'], + 'jsm': 'resource://gre/modules/Prompter.jsm', + 'constructor': 'EmbedPrompter', + }, +] diff --git a/toolkit/components/prompts/src/moz.build b/toolkit/components/prompts/src/moz.build index b13e47b42683..9b991c2e9189 100644 --- a/toolkit/components/prompts/src/moz.build +++ b/toolkit/components/prompts/src/moz.build @@ -4,13 +4,12 @@ # 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_COMPONENTS += [ - 'nsPrompter.js', - 'nsPrompter.manifest', -] - EXTRA_JS_MODULES += [ 'CommonDialog.jsm', + 'Prompter.jsm', 'SharedPromptUtils.jsm', ] +XPCOM_MANIFESTS += [ + 'components.conf', +] diff --git a/toolkit/components/prompts/src/nsPrompter.manifest b/toolkit/components/prompts/src/nsPrompter.manifest deleted file mode 100644 index 582f6bf59729..000000000000 --- a/toolkit/components/prompts/src/nsPrompter.manifest +++ /dev/null @@ -1,6 +0,0 @@ -component {1c978d25-b37f-43a8-a2d6-0c7a239ead87} nsPrompter.js -contract @mozilla.org/prompter;1 {1c978d25-b37f-43a8-a2d6-0c7a239ead87} -component {6e134924-6c3a-4d86-81ac-69432dd971dc} nsPrompter.js -contract @mozilla.org/network/authprompt-adapter-factory;1 {6e134924-6c3a-4d86-81ac-69432dd971dc} -component {7ad1b327-6dfa-46ec-9234-f2a620ea7e00} nsPrompter.js -contract @mozilla.org/embedcomp/prompt-service;1 {7ad1b327-6dfa-46ec-9234-f2a620ea7e00}