sessionStorage variables not being copied to new tab
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: niloy.mondal84, Unassigned)
Details
(Keywords: testcase-wanted)
Attachments
(1 file)
988 bytes,
application/octet-stream
|
Details |
User Agent: Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.10 Steps to reproduce: Created a page "page1.html" with stores some values in sessionStorage. Created a anchor link on page1.html that points to "page2.html" in the same domain. Right click on the page2 anchor and select "open in new tab" Actual results: page2.html does not have any session variables that were created in page1.html Expected results: The session variables in page1.html should have been "copied" to page2.html as per the spec. Opera does this. This is required for web applications using sessionStorage to work correctly with "open in new tab".
Comment 1•12 years ago
|
||
Niloy, thank you for pointing this out. Could you please attach a testcase, in order to reproduce the issue?
Updated•12 years ago
|
Reporter | ||
Comment 2•12 years ago
|
||
Please extract the zip to a http server and open page1.html
Comment 3•12 years ago
|
||
Using the STR from the description and the provided testcase, I was able to reproduce the issue on the latest Nightly. User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:20.0) Gecko/20121210 Firefox/20.0 Build ID: 20121210030747
Updated•12 years ago
|
Updated•12 years ago
|
Comment 4•11 years ago
|
||
This certainly doesn't belong to sessionstore. Is this still an issue?
Comment 6•11 years ago
|
||
This is a docshell or window watcher bug. The cloning it self works, just needs to be called on when data has to be carried. I'll take a look. Thanks for the test case.
Comment 7•11 years ago
|
||
Boris, what code paths are ran when we middle-click a link? We are cloning data for window.open() in window watcher. However there is no storage cloning added for middle-clicking a link. This is not a regression from bug 600307. I've just tested with Firefox 22 and the behavior is the same. So, this bug is there since ever and nobody complained.
Comment 8•11 years ago
|
||
Also, I'm not able to confirm in any spec that middle-click has to clone. Niloy, can you lead me to the exact part of a spec you talk about at comment 0? Thanks.
Comment 9•11 years ago
|
||
Re: codepath, looks like openLinkIn -> loadOneTab -> addTab -> loadURIWithFlags -> nsIWebNavigation::LoadURI.
Reporter | ||
Comment 10•11 years ago
|
||
Spec: http://www.w3.org/TR/2013/REC-webstorage-20130730/#the-sessionstorage-attribute >When a new top-level browsing context is created by a script in an existing browsing context, >or by the user following a link in an existing browsing context, or in some other way related >to a specific Document, then the session storage area of the origin of that Document must be >copied into the new browsing context when it is created. From that point on, however, the two >session storage areas must be considered separate, not affecting each other in any way.
Comment 11•8 years ago
|
||
I'm kinda surprised that there is no big push on this bug. I would expect much more reports on this issue, since this bug is there since ever and makes sessionStorage uses quite limiting. It's sad we have so different code paths for opening a new windows and a new tab... for ref, non-e10s stack for middle click on <a>: 0 _loadURIWithFlags(browser = [object XULElement], uri = "http://test.local.i7/p/sessionstorage/clone-middle-click-trg.html", params = [object Object]) ["chrome://browser/content/browser.js":839] this = [object ChromeWindow] 1 loadURIWithFlags(aURI = "http://test.local.i7/p/sessionstorage/clone-middle-click-trg.html", aFlags = [object Object]) ["chrome://browser/content/tabbrowser.xml":6642] this = [object XULElement] 2 addTab(aURI = "http://test.local.i7/p/sessionstorage/clone-middle-click-trg.html", aReferrerURI = [xpconnect wrapped nsIURI @ 0x7962eb0 (native @ 0xcc8eb04)]) ["chrome://browser/content/tabbrowser.xml":1918] this = [object XULElement] 3 loadOneTab(aURI = "http://test.local.i7/p/sessionstorage/clone-middle-click-trg.html", aReferrerURI = [xpconnect wrapped nsIURI @ 0x7962eb0 (native @ 0xcc8eb04)]) ["chrome://browser/content/tabbrowser.xml":1419] this = [object XULElement] 4 openLinkIn(url = "http://test.local.i7/p/sessionstorage/clone-middle-click-trg.html", where = "tab", params = [object Object]) ["chrome://browser/content/utilityOverlay.js":358] this = [object ChromeWindow] 5 handleLinkClick(event = [object MouseEvent], href = "http://test.local.i7/p/sessionstorage/clone-middle-click-trg.html", linkNode = http://test.local.i7/p/sessionstorage/clone-middle-click-trg.html) ["chrome://browser/content/browser.js":5434] this = [object ChromeWindow] 6 contentAreaClick(event = [object MouseEvent]) ["chrome://browser/content/browser.js":5365] this = [object XULElement] and e10s stack: 0 WebNavigation.loadURI(uri = "http://test.local.i7/p/sessionstorage/clone-middle-click-trg.html", flags = 0, referrer = [xpconnect wrapped nsIURI @ 0xadfcd90 (native @ 0x68fd9c4)], referrerPolicy = 0, postData = null, headers = null, baseURI = null) ["chrome://global/content/browser-child.js":293] this = [object Object] 1 WebNavigation.receiveMessage(message = [object Object]) ["chrome://global/content/browser-child.js":244] this = [object Object] jdm, it seems like you know better this code and thus know where to put the cloning code. We do this correctly for opening a new window: http://hg.mozilla.org/mozilla-central/annotate/1dbe350b57b1/embedding/components/windowwatcher/nsWindowWatcher.cpp#l992 Could you help please? At least point at the right place?
Comment 12•8 years ago
|
||
Correct me if I am wrong but once you right click "Page 2" and select "open in new tab" a new session is started. Correct? I tested this with localStorage and it works perfectly fine. Why not take that route? If sessionStorage is preferred, I'd recommend using Get and Post.
Comment 13•8 years ago
|
||
Josh, ping on ni. Disassigning in the meantime.
Comment 14•8 years ago
|
||
It's been three years since I spent any time looking at this. Any information I provide at this point will require me to start from scratch and re-learn everything, so I don't think there's any point in waiting for me.
Comment 15•8 years ago
|
||
Based on comment 9 you definitely know more than me, Josh. Since there is not much of a complain here from anyone else than the reporter, I'm really not going to work on this any time soon.
Assignee | ||
Updated•5 years ago
|
Comment 16•4 years ago
|
||
Any update on this.?
All other browsers now support this feature except firefox.!
Comment 17•4 years ago
|
||
Click the link with target="_blank", sessionStorage also lost.
check this example:
http://jsfiddle.net/P9nUv/3/
Comment 18•4 years ago
|
||
So sad about that. So long and still unsolved. We recommend using Chrome in our application due to the limitation of sessionStorage.
Currently, even behind Microsoft in this regard, which migrated to Chromium
Comment 19•3 years ago
|
||
Try using window.open(your_link,"_blank") . it magically worked in firefox too in my case
Comment 20•3 years ago
|
||
This did not work for me. It think most of us would appreciate an update - this bug has been there for 8 (!) years and it's still unresolved.
Comment 21•3 years ago
|
||
(In reply to Suresh from comment #19)
Try using window.open(your_link,"_blank") . it magically worked in firefox too in my case
window.open works, but the tragedy is it clears all the values you had entered in the fields, including files selected for uploads.
Comment 22•2 years ago
|
||
It seems like still not fixed. I created a test scenario:
https://codepen.io/szalonna/full/ZExpPYR
This works fine on everything, except:
- sometimes fails on Firefox@Windows
- always fails on Firefox@Linux
Updated•2 years ago
|
Comment 23•1 year ago
|
||
Hi all,
is there a chance that this is going to be fixed? We are also facing an issue where we would expect the session storage to be copied when duplicating a tab. This works fine in Chrome and Edge but not on Firefox.
Thanks.
Description
•