nsCOMPtr<nsIURI> uri; doc->GetDocumentURL(getter_AddRefs(uri));
PRBool IsPopupBlocked(nsIDOMDocument* aDoc){  PRBool blocked = PR_FALSE;  nsCOMPtr<nsIDocument> doc(do_QueryInterface(aDoc));  nsCOMPtr<nsIPopupWindowManager> pm(do_GetService(NS_POPUPWINDOWMANAGER_CONTRACTID));  if (pm && doc) {    nsCOMPtr<nsIURI> uri;    doc->GetDocumentURL(getter_AddRefs(uri));    PRUint32 permission = nsIPopupWindowManager::ALLOW_POPUP;    pm->TestPermission(uri, &permission);    blocked = (permission == nsIPopupWindowManager::DENY_POPUP);  }  return blocked;}