nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event)); privateEvent->SetTrusted(PR_TRUE);
void FirePopupBlockedEvent(nsIDOMDocument* aDoc,                           nsIURI *aRequestingURI, nsIURI *aPopupURI,                           const nsAString &aPopupWindowFeatures){  if (aDoc) {    // Fire a "DOMPopupBlocked" event so that the UI can hear about blocked popups.    nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(aDoc));    nsCOMPtr<nsIDOMEvent> event;    docEvent->CreateEvent(NS_LITERAL_STRING("PopupBlockedEvents"), getter_AddRefs(event));    if (event) {      nsCOMPtr<nsIDOMPopupBlockedEvent> pbev(do_QueryInterface(event));      pbev->InitPopupBlockedEvent(NS_LITERAL_STRING("DOMPopupBlocked"),              PR_TRUE, PR_TRUE, aRequestingURI, aPopupURI, aPopupWindowFeatures);      PRBool noDefault;      nsCOMPtr<nsIDOMEventTarget> targ(do_QueryInterface(aDoc));      targ->DispatchEvent(event, &noDefault);    }  }}