| OLD | NEW |
| 1 <script type="text/javascript"> | 1 <script type="text/javascript"> |
| 2 function sizeChanged(evt) { | 2 function sizeChanged(evt) { |
| 3 var data = JSON.parse(evt.detail); | 3 var data = JSON.parse(evt.detail); |
| 4 document.title = "AutoSize(" + data.newWidth + ", " + data.newHeight + ")"; | 4 document.title = "AutoSize(" + data.newWidth + ", " + data.newHeight + ")"; |
| 5 } | 5 } |
| 6 | 6 |
| 7 function loadAbort(evt) { | 7 function loadAbort(evt) { |
| 8 document.title = JSON.parse(evt.detail).reason; | 8 document.title = JSON.parse(evt.detail).reason; |
| 9 } | 9 } |
| 10 function loadStart(evt) { | 10 function loadStart(evt) { |
| 11 document.title = JSON.parse(evt.detail).url; | 11 document.title = JSON.parse(evt.detail).url; |
| 12 } | 12 } |
| 13 function loadStop(evt) { | 13 function loadStop(evt) { |
| 14 document.title = "loadStop"; | 14 document.title = "loadStop"; |
| 15 } | 15 } |
| 16 | 16 |
| 17 var commitIsTopLevel; | |
| 18 function loadCommit(evt) { | |
| 19 var detail = JSON.parse(evt.detail); | |
| 20 document.title = "loadCommit:" + detail.url; | |
| 21 commitIsTopLevel = detail.isTopLevel; | |
| 22 } | |
| 23 | |
| 24 var redirectOldUrl; | 17 var redirectOldUrl; |
| 25 var redirectNewUrl; | 18 var redirectNewUrl; |
| 26 function loadRedirect(event) { | 19 function loadRedirect(event) { |
| 27 document.title = "redirected"; | 20 document.title = "redirected"; |
| 28 var detail = JSON.parse(event.detail); | 21 var detail = JSON.parse(event.detail); |
| 29 if (detail.isTopLevel) { | 22 if (detail.isTopLevel) { |
| 30 redirectOldUrl = detail.oldUrl; | 23 redirectOldUrl = detail.oldUrl; |
| 31 redirectNewUrl = detail.newUrl; | 24 redirectNewUrl = detail.newUrl; |
| 32 } | 25 } |
| 33 } | 26 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 window.document.title = 'main guest'; | 93 window.document.title = 'main guest'; |
| 101 } | 94 } |
| 102 } | 95 } |
| 103 } | 96 } |
| 104 var plugin = document.getElementById('plugin'); | 97 var plugin = document.getElementById('plugin'); |
| 105 plugin.addEventListener('-internal-loadstart', loadStart); | 98 plugin.addEventListener('-internal-loadstart', loadStart); |
| 106 plugin.addEventListener('-internal-loadabort', loadAbort); | 99 plugin.addEventListener('-internal-loadabort', loadAbort); |
| 107 plugin.addEventListener('-internal-loadredirect', loadRedirect); | 100 plugin.addEventListener('-internal-loadredirect', loadRedirect); |
| 108 window.addEventListener('message', receiveMessage, false); | 101 window.addEventListener('message', receiveMessage, false); |
| 109 plugin.addEventListener('-internal-loadstop', loadStop); | 102 plugin.addEventListener('-internal-loadstop', loadStop); |
| 110 plugin.addEventListener('-internal-loadcommit', loadCommit); | |
| 111 plugin.addEventListener('-internal-sizechanged', sizeChanged); | 103 plugin.addEventListener('-internal-sizechanged', sizeChanged); |
| 112 </script> | 104 </script> |
| OLD | NEW |