2 <body onload=
"dropFrame()">
3 This represents not an extension, but an HTML page within an untrusted
9 var s
= location
.href
.toString();
10 if (s
.indexOf('127.0.0.1') > 0) {
11 // try to frame a copy of an error page from the webstore origin, but
12 // not under the webstore root directory. The server does not send
13 // an x-frame-options header for the error page.
14 var f
= document
.createElement('iframe');
15 s
= s
.replace('127.0.0.1', 'www.example.com');
16 s
= s
.replace('/files/', '/nonesuch/');
18 f
.onload
= checkFrame
;
19 f
.onerror
= checkFrame
;
20 document
.body
.appendChild(f
);
21 // Due to https://bugs.webkit.org/show_bug.cgi?id=90660 neither onload
22 // or onerror fires when interrupted by XFO, so use a setInterval()
23 // workaround. Remove this workaround when resolved.
24 interval_id
= setInterval("checkFrame()", 500);
28 function checkFrame() {
30 // If the frame was blocked, we instead have an about:blank frame which we
32 x
= window
.frames
[0].document
.location
.href
;
33 document
.title
= 'PASS: ' + x
;
34 clearInterval(interval_id
);
37 // Frame was not yet blocked, so we have no access.
38 if (++check_count
> 40) {
39 document
.title
= 'FAIL';
40 clearInterval(interval_id
);