[Project_owners] Hooking HTTP Basic Authentication dialog

Eric Jung grimholtz at yahoo.com
Fri Sep 16 23:19:37 EDT 2005


Hi,


--- Michael Vincent <mv_van_rantwijk at yahoo.com> wrote:

> Eric Jung wrote:
> > Hi,
> > I'd like my extension to be notified when an HTTP Basic
> > Authentication dialog (like when you go here:
> > http://passwordmaker.org:2082/) is displayed and be able to write
> to
> > the input boxes of this dialog.
> > 
> > Does a standard pageLoad eventListener intercept this, or is it
> more
> > complex?
> > 
> > Thanks for any advice,
> > Eric Jung
> 
> FYI: that dialog is commonDialog.xul/commonDialog.js
> and you can use  registerNotification in nsIWindowWatcher.idl
> 

OK, I'm getting notifications now but can't find references to the
username & password input boxes:

var watcher = 
  Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
    .createInstance(Components.interfaces.nsIWindowWatcher);
    watcher.registerNotification(this);

observe : function(domWindow, topic, data) {
  if (topic == "domwindowopened") {
    domWindow = 
      domWindow.QueryInterface(Components.interfaces.nsIDOMWindow);
      var user = domWindow.document.getElementById("loginTextbox");
      var pw = domWindow.document.getElementById("password1Textbox");
      dump(user + "\n");
      dump(pw + "\n");
    }
  },

This dumps null and null to the console.... :(
FWIW, I can't find commonDialog.xul/commonDialog.js in FF (but maybe
I missed it?), just Mozilla.


> Yeah, I'm totally crazy to be still awake at 12:40AM, but I got the
> day 
> off tomorrow, and I still have to fix something ;)
> 

Heh. An all-night coding session. Those can be fun, but take care of
your health.

Regards,
Eric


> Michael
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Project_owners mailing list