Difference between revisions of "Mozilla.dev.embedding"

From CDOT Wiki
Jump to: navigation, search
(Weekly Summaries)
(rebuilt a small part of the FAQ)
Line 6: Line 6:
  
 
# Cesar
 
# Cesar
 +
 +
There is already an [http://developer.mozilla.org/en/docs/Mozilla_Embedding_FAQembedding FAQ on mozilla] that probably wasn't properly linked in with Mozilla's FAQ page. Instead, I am going to make a list of asked questions on this page and mozilla can put it into their FAQ at their discretion.
 +
<!--[[20060929embedding| September 22, 2006 - September 29, 2009]] <br>
 +
[http://developer.mozilla.org/en/docs/Newsgroup_summaries:mozilla-dev-embedding September 29, 2006 - October 6, 2006]
 +
The newsgroup is more FAQ than discussion. So you can find the FAQ on [http://developer.mozilla.org/en/docs/embedding_FAQ mozilla]-->
  
 
== FAQ ==
 
== FAQ ==
<!--[[20060929embedding| September 22, 2006 - September 29, 2009]] <br>
+
===nsIPromptService with secure sites===
[http://developer.mozilla.org/en/docs/Newsgroup_summaries:mozilla-dev-embedding September 29, 2006 - October 6, 2006]-->
+
The problem is getting "Security Error: Domain Name Mismatch" when visting certain secure sites. You get no text and no functionality. There are two possible solutions to this error.
The newsgroup is more FAQ than discussion. So you can find the FAQ on [http://developer.mozilla.org/en/docs/embedding_FAQ mozilla]
+
#The Dialog is not handled by the prompt service. You must implement another interface (for example, nsIBadCertListener)
 +
#The original dialog does not work correctly because your application is not handling chrome correctly. Here are some things other people have used to solve their problems :
 +
#*This will get the text in the security popup and allow you to view the certificate : <br/> In the nsIWindowCreator::CreateChromeWindow() implementation, change the doc shell tree item's type to ''nsIDocShellTreeItem::typeChromeWrapper'' to ''nsIDocShellTreeItem::typeContentWrapper'' to view the certificate. You can nsIWebBrowserChrome::CHROME_OPENAS_CHROME to check when to use typeChromeWrapper and typeContentWrapper
 +
#*This will tell the browser to progress to the secure site
 +
<code>
 +
:nsCOMPtr<nsIJSContextStack> stack(do_GetService("@mozilla.org/js/xpc/ContextStack;1"));
 +
if (stack && NS_SUCCEEDED(stack->Push(nsnull))) {
 +
  /* Display the modal window here */
 +
  JSContext* cx;
 +
  stack->Pop(&cx);
 +
}</code>

Revision as of 16:28, 13 October 2006

Newsgroup

Mozilla.dev.embedding

Authors

  1. Cesar

There is already an FAQ on mozilla that probably wasn't properly linked in with Mozilla's FAQ page. Instead, I am going to make a list of asked questions on this page and mozilla can put it into their FAQ at their discretion.

FAQ

nsIPromptService with secure sites

The problem is getting "Security Error: Domain Name Mismatch" when visting certain secure sites. You get no text and no functionality. There are two possible solutions to this error.

  1. The Dialog is not handled by the prompt service. You must implement another interface (for example, nsIBadCertListener)
  2. The original dialog does not work correctly because your application is not handling chrome correctly. Here are some things other people have used to solve their problems :
    • This will get the text in the security popup and allow you to view the certificate :
      In the nsIWindowCreator::CreateChromeWindow() implementation, change the doc shell tree item's type to nsIDocShellTreeItem::typeChromeWrapper to nsIDocShellTreeItem::typeContentWrapper to view the certificate. You can nsIWebBrowserChrome::CHROME_OPENAS_CHROME to check when to use typeChromeWrapper and typeContentWrapper
    • This will tell the browser to progress to the secure site

:nsCOMPtr<nsIJSContextStack> stack(do_GetService("@mozilla.org/js/xpc/ContextStack;1"));
if (stack && NS_SUCCEEDED(stack->Push(nsnull))) {
  /* Display the modal window here */
  JSContext* cx;
  stack->Pop(&cx);
}