Status: Unconfirmed
Owner: ----
Labels: Type-Bug Pri-2 OS-All Area-Misc

New issue 9531 by anieve01: Cannot get reference in one window to another  
window eventhough both originate from the same domain
http://code.google.com/p/chromium/issues/detail?id=9531

Chrome Version       : <Copy from: 'about:version'>
URLs (if applicable) :
Other browsers tested:
   Add OK or FAIL after other browsers where you have tested this issue:

   Firefox 3.x: OK
          IE 7: OK
          IE 8: OK

What steps will reproduce the problem?
1. open a web page at example.com/a.html (“Window A”), which has javascript
that sets the window’s name to ‘window_a’ using window.name = ‘window_a’
2. open another web page in a new tab or window at example.com/b.html
(“Window B”)
3. Window B contains javascript that tries to access Window A’s DOM as  
follows:

-----------------
var window_a = open('', 'window_a');

if(window_a && window_a.location.href.indexOf('http') >= 0){
        alert(‘have access’);
}else{
        alert(‘no access’);
}

-----------------


What is the expected result?
alert('have access') fires

What happens instead?
alert(‘no access’) fires


This code above fails to get access to Window A’s DOM.  It is successful in
other browsers (Firefox, IE, etc).  The only time this code is successful
is when there’s a link in Window A that opens Window B in a new window or
tab.  If you open Window B in a new tab or window manually, the code fails.

There are next generation web applications that use a bookmarklet to
transfer data from one window to another, which cannot be used in Chrome
due to this issue.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to