Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Side by Side Diff: content/test/data/browser_plugin_embedder.html

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed crash + cleanup Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <script type="text/javascript"> 1 <script type="text/javascript">
2 function SetSrc(src) { 2 function SetSrc(src) {
3 plugin = document.getElementById('plugin'); 3 plugin = document.getElementById('plugin');
4 plugin.src = src; 4 plugin.src = src;
5 } 5 }
6 function SetSize(w, h) { 6 function SetSize(w, h) {
7 plugin = document.getElementById('plugin'); 7 plugin = document.getElementById('plugin');
8 plugin.width = w; 8 plugin.width = w;
9 plugin.height = h; 9 plugin.height = h;
10 } 10 }
11 function PostMessage(data) {
12 plugin = document.getElementById('plugin');
13 plugin.postMessage('testing123', '');
nasko 2012/09/19 21:19:59 The second param is the target origin, right? If y
14 }
11 </script> 15 </script>
12 16
13 <object id="plugin" 17 <object id="plugin"
14 tabindex="0" 18 tabindex="0"
15 type="application/new-browser-plugin" 19 type="application/new-browser-plugin"
16 width="640" 20 width="640"
17 height="480" 21 height="480"
18 border="0px"></object> 22 border="0px"></object>
23 <script type="text/javascript">
24 var msg;
25 function receiveMessage(event) {
26 msg = event.data;
27 if (msg != 'stop_ack') {
nasko 2012/09/19 21:19:59 Shouldn't that be !==?
Fady Samuel 2012/09/20 15:24:28 Done.
28 event.source.postMessage('stop', '*');
29 } else {
30 window.document.title = 'stop_ack';
31 }
32 }
33 document.getElementById('plugin').addEventListener('message', receiveMessage, fa lse);
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698