not reset on cross-site navigations




Document Navigation
5 years ago
5 years ago


(Reporter: David Eyk, Unassigned)


17 Branch

Firefox Tracking Flags

(Not tracked)




5 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11

Steps to reproduce:

1. Visit
2. Evaluate `` in the Web Console. Should result in the empty string.
3. Visit
4. Evaluate `` in the Web Console. Should be "bgmain".
5. Visit
6. Evaluate `` in the Web Console. Should result in the empty string. Instead, results in "bgmain".

Actual results:

A non-empty value of `` persists between sites.

Expected results:

The value of `` should not persist between sites. :)

Comment 1

5 years ago
FYI, I'm submitting this bug in Chrome (sorry), but I've verified this behavior in FF 17 on both OS X and Windows.


5 years ago
Component: Untriaged → DOM
Product: Firefox → Core

Comment 2

5 years ago
relevant Bug 191807

Comment 3

5 years ago
I can  confirm the behavior in Nightly20.0a1 on Windows7.
And the behavior exists in at least Firefox1.5.
Ever confirmed: true
OS: Mac OS X → All

Comment 4

5 years ago
If it helps to understand why this bug matters, `` is often used as a fall-back for localStorage, a method popularized by Remy Sharp ( 

Aside from the obvious data-privacy issues if is used in place of localStorage, Lawnchair.js ( is a popular localStorage polyfill that unfortunately explodes when contains non-JSON-encoded data (see

Comment 5

5 years ago
The behavior of Opera12.11 and IE9 is as same as Firefox.
Google Chrome23.0.1271.97m is as same as the Expected results in comment #0.
The name is attached to the browsing context, not to a particular window.  See

We should perhaps implement the "reset when doing a cross-domain navigation" part, though.  That said, that part of the spec makes no sense when an <iframe name> is involved, so I'd sort of like for that to get sorted out before we start making changes, because implementing what the spec says right now would break the web.  Someone who cares about this should get the spec sorted out, please...
Component: DOM → Document Navigation
Summary: not cleared between sites. → not reset on cross-site navigations
Ah, so the spec says to only reset the name on navigation if the browsing context is a toplevel browsing context _and_ doesn't have an opener.

Which is fairly silly, since it means you can bypass that protection easily if you're an attacker, but ok.  At least it's probably web-compatible.
Duplicate of this bug: 269174
You need to log in before you can comment on or make changes to this bug.