| 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) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 function PostMessage(data, shouldTargetIframe) { | 36 function PostMessage(data, shouldTargetIframe) { |
| 37 plugin = document.getElementById('plugin'); | 37 plugin = document.getElementById('plugin'); |
| 38 // TODO(fsamuel): contentWindow can be accessed directly once | 38 // TODO(fsamuel): contentWindow can be accessed directly once |
| 39 // http://wkbug.com/85679 lands. | 39 // http://wkbug.com/85679 lands. |
| 40 if (shouldTargetIframe) { | 40 if (shouldTargetIframe) { |
| 41 plugin.contentWindow.frames[0].postMessage('testing123', '*'); | 41 plugin.contentWindow.frames[0].postMessage('testing123', '*'); |
| 42 } else { | 42 } else { |
| 43 plugin.contentWindow.frames.postMessage('testing123', '*'); | 43 plugin.contentWindow.frames.postMessage('testing123', '*'); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 function Back() { | |
| 47 var plugin = document.getElementById('plugin'); | |
| 48 plugin.back(); | |
| 49 } | |
| 50 function CanGoBack() { | |
| 51 var plugin = document.getElementById('plugin'); | |
| 52 return plugin.canGoBack(); | |
| 53 } | |
| 54 function CanGoForward() { | |
| 55 var plugin = document.getElementById('plugin'); | |
| 56 return plugin.canGoForward(); | |
| 57 } | |
| 58 function Forward() { | |
| 59 var plugin = document.getElementById('plugin'); | |
| 60 plugin.forward(); | |
| 61 } | |
| 62 function Go(relativeIndex) { | |
| 63 var plugin = document.getElementById('plugin'); | |
| 64 plugin.go(relativeIndex); | |
| 65 } | |
| 66 function SetTitle(str) { | 46 function SetTitle(str) { |
| 67 document.title = str; | 47 document.title = str; |
| 68 } | 48 } |
| 69 document.title = 'embedder'; | 49 document.title = 'embedder'; |
| 70 </script> | 50 </script> |
| 71 | 51 |
| 72 <object id="plugin" | 52 <object id="plugin" |
| 73 tabindex="0" | 53 tabindex="0" |
| 74 type="application/browser-plugin" | 54 type="application/browser-plugin" |
| 75 width="640" | 55 width="640" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 95 } | 75 } |
| 96 } | 76 } |
| 97 var plugin = document.getElementById('plugin'); | 77 var plugin = document.getElementById('plugin'); |
| 98 plugin.addEventListener('-internal-loadstart', loadStart); | 78 plugin.addEventListener('-internal-loadstart', loadStart); |
| 99 plugin.addEventListener('-internal-loadabort', loadAbort); | 79 plugin.addEventListener('-internal-loadabort', loadAbort); |
| 100 plugin.addEventListener('-internal-loadredirect', loadRedirect); | 80 plugin.addEventListener('-internal-loadredirect', loadRedirect); |
| 101 window.addEventListener('message', receiveMessage, false); | 81 window.addEventListener('message', receiveMessage, false); |
| 102 plugin.addEventListener('-internal-loadstop', loadStop); | 82 plugin.addEventListener('-internal-loadstop', loadStop); |
| 103 plugin.addEventListener('-internal-sizechanged', sizeChanged); | 83 plugin.addEventListener('-internal-sizechanged', sizeChanged); |
| 104 </script> | 84 </script> |
| OLD | NEW |