Simple thing happens with a Firefox 22 and higher: if you have a frame with a name "name1"
and you renamed it to "name2"
then the "name1"
still will be present in a window.frames
array but it's value would be undefined
. The same thing happens if you call delete window.frames["name1"];
.
The problem is that you couldn't directly place any item into frames
array with a name "name1"
in this case. Also you couldn't add the property name1
into that window object.
The only way to do this is change the some frame name to "name1"
. However our current application logic need to access the same frame both by "name1"
and "name2"
in the same time.
Here the sample: http://jsfiddle.net/tigeral/2VwFV/2/ .Please compare results in both Firefox 21 and 22.
Does anyone know a workaround how to make follow code working ?
window.frames["name1"].name = "name2";
// what I need to do here ?
window.frames["name1"] = window.frames["name2"];
alert(window.frames["name1"].name);
P.s. the similar question was already posted on Stack Overflow, but my case requires a different solution. window.frames["frame_name"] doesn't work in Firefox when frame has been removed and readded