Closed
Bug 882977
Opened 13 years ago
Closed 13 years ago
Identity state of IDENTITY_MODE_UNKNOWN is set for about:home when a new window is created
Categories
(Firefox :: Security, defect)
Firefox
Security
Tracking
()
RESOLVED
FIXED
Firefox 25
People
(Reporter: jaws, Assigned: jaws)
References
Details
(Whiteboard: fixed by bug 893424)
Attachments
(1 file, 3 obsolete files)
|
2.71 KB,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
about:home should have an identity state of IDENTITY_MODE_CHROMEUI, but instead it ends up with an identity state of IDENTITY_MODE_UNKNOWN when a new window is created.
Setting a breakpoint within onSecurityChange shows that the location is set as about:blank, which leads the location.protocol to become "http:".
Gavin, do you know how we can change gBrowser.contentWindow.location to return about:home when a new window is created instead of about:blank?
Flags: needinfo?(gavin.sharp)
Comment 1•13 years ago
|
||
(In reply to Jared Wein [:jaws] from comment #0)
> about:home should have an identity state of IDENTITY_MODE_CHROMEUI, but
> instead it ends up with an identity state of IDENTITY_MODE_UNKNOWN when a
> new window is created.
What do you mean by "when a new window is created"? Are you saying there's a behavior difference between loading about:home in an existing window, and having it load in a new window (with e.g. Shift+Go button)? STR would help.
From what you describe, it seems likely that we'd need to change when onSecurityChange is firing (frequency or timing).
Flags: needinfo?(gavin.sharp)
| Assignee | ||
Comment 2•13 years ago
|
||
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #1)
> (In reply to Jared Wein [:jaws] from comment #0)
> > about:home should have an identity state of IDENTITY_MODE_CHROMEUI, but
> > instead it ends up with an identity state of IDENTITY_MODE_UNKNOWN when a
> > new window is created.
>
> What do you mean by "when a new window is created"? Are you saying there's a
> behavior difference between loading about:home in an existing window, and
> having it load in a new window (with e.g. Shift+Go button)? STR would help.
>
> From what you describe, it seems likely that we'd need to change when
> onSecurityChange is firing (frequency or timing).
Sorry, here's clearer STR:
1) In a pre-existing window, visit about:home
2) Use DOMi to check the className on #identity-box
3) It should be '.chromeUI'
4) Make sure that your home page is set to about:home
5) Press Ctrl+N (or Cmd+N if on a Mac) to open a new window
6) Use DOMi to check the className on #identity-box
Expected:
7a) It should be '.chromeUI'
Actual:
7b) It is '.unknownIdentity'
(In reply to Jared Wein [:jaws] from comment #2)
> (In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment
> #1)
> > (In reply to Jared Wein [:jaws] from comment #0)
> > > about:home should have an identity state of IDENTITY_MODE_CHROMEUI, but
> > > instead it ends up with an identity state of IDENTITY_MODE_UNKNOWN when a
> > > new window is created.
> >
> > What do you mean by "when a new window is created"? Are you saying there's a
> > behavior difference between loading about:home in an existing window, and
> > having it load in a new window (with e.g. Shift+Go button)? STR would help.
> >
> > From what you describe, it seems likely that we'd need to change when
> > onSecurityChange is firing (frequency or timing).
>
> Sorry, here's clearer STR:
>
> 1) In a pre-existing window, visit about:home
> 2) Use DOMi to check the className on #identity-box
> 3) It should be '.chromeUI'
> 4) Make sure that your home page is set to about:home
> 5) Press Ctrl+N (or Cmd+N if on a Mac) to open a new window
> 6) Use DOMi to check the className on #identity-box
>
> Expected:
> 7a) It should be '.chromeUI'
>
> Actual:
> 7b) It is '.unknownIdentity
In Nightly another similar problem is that, for example, if I select from the help menu "Troubleshooting information" the page that opens have '.unknownIdentity' and shows the globe in the identity box but if I reload the page with the stop and reload button the identity state of the page become '.chromeUI' and shows the firefox icon in the identity box
| Assignee | ||
Comment 5•13 years ago
|
||
Tim, what do you think about landing this test now?
Attachment #772124 -
Flags: review?(ttaubert)
Comment 6•13 years ago
|
||
Comment on attachment 772124 [details] [diff] [review]
browser-chrome test that reproduces the issue
>+ gNewWin = openDialog(getBrowserURL(), "_blank",
>+ "chrome,dialog=no,location=yes,toolbar=yes", "about:home");
OpenBrowserWindow()
>+ ok(gNewWin, "got new window");
>+ whenDelayedStartupFinished(gNewWin, function() {
>+ let firstTab = gNewWin.gBrowser.selectedTab;
>+
>+ // This is being tracked by bug 882977.
>+ todo_is(getIdentityMode(), "chromeUI", "Identity should be chrome");
Delayed startup merely starts loading about:home. What makes you think the identity mode should already be updated by the time this check happens?
>+ is(getIdentityMode(), "unknownIdentity", "Identity should be chrome but is currently " +
>+ "shown as unknownIdentity for new windows.");
Given the above todo_is, what's the point of this?
Attachment #772124 -
Flags: review?(ttaubert) → review-
| Assignee | ||
Comment 7•13 years ago
|
||
(In reply to Dão Gottwald [:dao] from comment #6)
> >+ is(getIdentityMode(), "unknownIdentity", "Identity should be chrome but is currently " +
> >+ "shown as unknownIdentity for new windows.");
>
> Given the above todo_is, what's the point of this?
Because while todo_is checks that the value isn't passing, it doesn't verify that the value isn't changing between test runs. If the test starts showing that about:home is having an identity mode of something other than unknownIdentity, while not chromeUI, then that would be a worthwhile issue to note.
| Assignee | ||
Comment 8•13 years ago
|
||
(In reply to Jared Wein [:jaws] from comment #7)
> (In reply to Dão Gottwald [:dao] from comment #6)
> > >+ is(getIdentityMode(), "unknownIdentity", "Identity should be chrome but is currently " +
> > >+ "shown as unknownIdentity for new windows.");
> >
> > Given the above todo_is, what's the point of this?
>
> Because while todo_is checks that the value isn't passing, it doesn't verify
> that the value isn't changing between test runs. If the test starts showing
> that about:home is having an identity mode of something other than
> unknownIdentity, while not chromeUI, then that would be a worthwhile issue
> to note.
But I see now that with the is() check, the todo_is() is no longer necessary.
| Assignee | ||
Comment 9•13 years ago
|
||
Addressed feedback.
Attachment #772124 -
Attachment is obsolete: true
Attachment #772130 -
Flags: review?(dao)
Comment 10•13 years ago
|
||
Comment on attachment 772130 [details] [diff] [review]
browser-chrome test that reproduces the issue v.2
>+ whenDelayedStartupFinished(win, function() {
>+ let browser = win.gBrowser.selectedBrowser;
>+ if (browser.contentDocument.readyState === "complete") {
>+ checkIdentityMode(win);
>+ return;
>+ }
The strict type checking of === isn't useful here, please use the way more common ==.
Are you sure this isn't racing anymore? When starting to load something, document.readyState is still "complete" for the previously loaded document (e.g. about:blank).
| Assignee | ||
Comment 11•13 years ago
|
||
(In reply to Dão Gottwald [:dao] from comment #10)
> Comment on attachment 772130 [details] [diff] [review]
> browser-chrome test that reproduces the issue v.2
>
> >+ whenDelayedStartupFinished(win, function() {
> >+ let browser = win.gBrowser.selectedBrowser;
> >+ if (browser.contentDocument.readyState === "complete") {
> >+ checkIdentityMode(win);
> >+ return;
> >+ }
>
> The strict type checking of === isn't useful here, please use the way more
> common ==.
I brought this over from http://mxr.mozilla.org/mozilla-central/source/browser/base/content/test/head.js#216.
Comment 12•13 years ago
|
||
Yes, there's existing code where === is used for no specific reason, but == is still more common.
| Assignee | ||
Comment 13•13 years ago
|
||
Attachment #772377 -
Flags: review?(dao)
| Assignee | ||
Updated•13 years ago
|
Attachment #772130 -
Attachment is obsolete: true
Attachment #772130 -
Flags: review?(dao)
| Assignee | ||
Comment 14•13 years ago
|
||
Forgot to undo a debug change.
Attachment #772377 -
Attachment is obsolete: true
Attachment #772377 -
Flags: review?(dao)
Attachment #772380 -
Flags: review?(dao)
Comment 15•13 years ago
|
||
Comment on attachment 772380 [details] [diff] [review]
browser-chrome test that reproduces the issue v.3.1
>+ registerCleanupFunction(function() {
>+ Services.prefs.clearUserPref("browser.startup.homepage");
>+ Services.prefs.clearUserPref("browser.startup.page");
>+ });
move win.close() here?
Attachment #772380 -
Flags: review?(dao) → review+
| Assignee | ||
Comment 16•13 years ago
|
||
Whiteboard: [leave open]
| Assignee | ||
Comment 17•13 years ago
|
||
Backed out for perma-oranging "Bug 885965 - Intermittent browser_typeAheadFind.js | Test timed out | Found a browser window after previous test timed out".
https://hg.mozilla.org/integration/fx-team/rev/fc3f64be0c1a
| Assignee | ||
Updated•13 years ago
|
Whiteboard: [leave open]
| Assignee | ||
Comment 18•13 years ago
|
||
Landed on top of a fix for bug 885965.
https://hg.mozilla.org/integration/mozilla-inbound/rev/36e932df9f6e
Whiteboard: [leave open]
Comment 19•13 years ago
|
||
Updated•13 years ago
|
Assignee: nobody → jaws
Updated•13 years ago
|
Flags: in-testsuite+
Whiteboard: [leave open] → fixed by bug 893424
Target Milestone: --- → Firefox 25
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•