Open Bug 800677 Opened 12 years ago Updated 2 years ago

Window location is unknown to "chrome-document-global-created" observers

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86_64
Windows 7
defect

Tracking

()

People

(Reporter: hultmann, Unassigned)

Details

Until Firefox 3.6, "chrome-document-global-created" observer, subject.location used to return the actual location of the window.

It doesn't happen in Firefox 4+.


Steps to reproduce:

* Paste the following code into Error Console:

Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
var obs = {
  QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
  observe: function(subject, topic, data) {
    Components.classes["@mozilla.org/consoleservice;1"]
      .getService(Components.interfaces.nsIConsoleService)
      .logStringMessage(topic + " [" + subject.location.href + "]");
  }
};
Components.classes["@mozilla.org/observer-service;1"]
  .getService(Components.interfaces.nsIObserverService)
  .addObserver(obs, "chrome-document-global-created", false);


* Press Ctrl+Shift+Del

* "Clear Recent History" window will appear

* In the Firefox error console:
  * Firefox 3.6.28: chrome-document-global-created [chrome://browser/content/sanitize.xul]
  * Firefox 4.0.1:  chrome-document-global-created [about:blank]
  * Firefox 16.0.1: chrome-document-global-created []
Yes, the global is created before the final URI is known.  You can add a load listener to figure out what's being loaded....
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.