Working with a java embedding of xulrunner 1.9.2 as an embedded
browser. Registered a custom implementation of nsIPromptService:

registrar.registerFactory(NS_PROMPTSERVICE_CID, "Prompt Service",
NS_PROMPTSERVICE_CONTRACTID, new nsIFactory() {

   private final PromptService promptService = new
PromptService(popupService);

   public nsISupports queryInterface(String uuid) {
      if(uuid.equals(nsIFactory.NS_IFACTORY_IID) ||
uuid.equals(nsIFactory.NS_ISUPPORTS_IID)) {
         return this;
      }
      return null;
   }

   public nsISupports createInstance(nsISupports outer, String iid) {
      return promptService;
   }

   public void lockFactory(boolean lock) {
   }
});

Tried just implementing nsIPromptService, alert and confirm calls in
javascript from loaded pages work fine, prompt fails with:

[JavaScript Error: "uncaught exception: [Exception... "Component
returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE)
[nsIJSCID.getService]"  nsresult: "0x80570016
(NS_ERROR_XPC_GS_RETURNED_FAILURE)"  location: "JS frame ::
file:///home/megan/Downloads/xulrunner-1.9.2/components/nsLoginManagerPrompter.js
:: anonymous :: line 150"  data: no]"]


Tried implementing nsIPromptService2, alert and confirm calls in
javascript from loaded pages work fine, prompt fails with:

[JavaScript Error: "uncaught exception: [Exception... "Component
returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIPromptService2.prompt]"  nsresult: "0x80004005
(NS_ERROR_FAILURE)"  location: "JS frame ::
file:///home/megan/Downloads/xulrunner-1.9.2/components/nsLoginManagerPrompter.js
:: anonymous :: line 267"  data: no]"]

Any help would be appreciated - not sure how to debug it further.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to