3 var iframe_hosts
= ['http://127.0.0.1', 'http://localhost', 'http://127.0.0.1'];
4 function getIFrameSrc(iframe_id
) {
5 var port
= location
.port
;
6 var path
= location
.pathname
.substring(0, location
.pathname
.lastIndexOf('/'));
7 var file
= 'simple.html';
9 file
= 'tab_destroyed_frame.html';
10 var url
= iframe_hosts
[iframe_id
] + ':' + port
+ path
+ '/' + file
;
13 function addIFrame(iframe_id
, iframe_src
) {
14 var id
= 'iframe_' + iframe_id
;
15 var iframe
= document
.getElementById(id
);
17 iframe
.src
= iframe_src
;
19 iframe
.src
= getIFrameSrc(iframe_id
);
21 return "" + iframe_id
;
25 <iframe id=
"iframe_0" name=
"iframe_0"></iframe>
26 <iframe id=
"iframe_1" name=
"iframe_1"></iframe>
27 <iframe id=
"iframe_2" name=
"iframe_2"></iframe>
28 Testing Geolocation with iframes.