Closed Bug 513619 Opened 15 years ago Closed 15 years ago

onLocationChange not being fired when you go back in history

Categories

(Core :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: Natch, Unassigned)

Details

var progressListener = {
  onLocationChange: function(aWebProgress, aLocation, aStatus) {
    alert(aWebProgress.currentURI.spec);
  }
}

gBrowser.addTabsProgressListener(progressListener);

gBrowser.selectedBrowser.goBack();

That code on Mac doesn't call the onLocationChange handler, as it does on all other platforms, see the different logs at:

WINNT: http://tinderbox.mozilla.org/showlog.cgi?log=MozillaTry/1251672391.1251678869.10114.gz&fulltext=1

Linux: http://tinderbox.mozilla.org/showlog.cgi?log=MozillaTry/1251672391.1251679771.19863.gz&fulltext=1

Mac: http://tinderbox.mozilla.org/showlog.cgi?log=MozillaTry/1251672391.1251680032.22429.gz&fulltext=1

Ignore all the debugging failures, the test toolbarButtons.js times out after the back-button is clicked because the onLocationChange handler isn't called.
qawanted: I don't have a mac, but I'll try to bundle up an extension for someone to try out on mac, I'm not sure if this is a regression or not, and I'm not 100% sure of the validity of this bug. The only confirmation I have is from tryserver runs with some logging enabled.
Keywords: qawanted
Actually, this should be enough:

var progressListener = {onLocationChange: function(aWebProgress, aRequest, aLocation) { alert("Location changed: " + aWebProgress.currentURI.spec); var cancel = confirm("Stop delivering these notifications?"); if (cancel) top.opener.gBrowser.removeTabsProgressListener(this);}}; top.opener.gBrowser.addTabsProgressListener(progressListener);

copy/paste that into the error console, then navigate to a page, you'll get an alert when the location of any tab in the window you opened the error console from is changed.

STR:

1) navigate to a about:robots*, make sure the back button is enabled.
2) open the error console (ctrl-shift-j) and type in the js above.
3) go back to the browser and hit back.
4) ensure you get a notification that the page has changed.

Note: you'll get some errors about certain functions that aren't implemented, you can safely ignore them.

* This can really be any about: page, as long as it gives you history (i.e. the back button is enabled), but I was testing with about: pages so I'd rather get the results of doing that. If you can test regular pages as well and post the result, that'd be great.
Yep, I get an alert when running through the steps to reproduce on OSX with build Id:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a1pre) Gecko/20090831 Minefield/3.7a1pre ID:20090831030956
Keywords: qawanted
Thanks so much! Anyhow, that makes this invalid, but leaves me in the dark. I can't imagine the tests in bug 512263 are too long for t-boxes, then again it just might be.

I would truly be indebted to you if you could apply the last patch in bug 512263 and report the results, then all you have to do (assuming you have MozillaBuild) is:

1) cd $OBJDIR/browser/base
2) make (assuming your build is in a working state)
3) TEST_PATH=browser/base/content make -C $OBJDIR mochitest-browser-chrome

If you've got some time, of course, not trying to push anything here :-)
No longer blocks: 512263
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: pp
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.