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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/test/data/browser_plugin_embedder.html
diff --git a/content/test/data/browser_plugin_embedder.html b/content/test/data/browser_plugin_embedder.html
index 31a78467a65d57d70e50da1e131de0351542d808..b34f884d0e86c9e2d4fb2d410ec4f265e5443794 100644
--- a/content/test/data/browser_plugin_embedder.html
+++ b/content/test/data/browser_plugin_embedder.html
@@ -8,6 +8,10 @@ function SetSize(w, h) {
plugin.width = w;
plugin.height = h;
}
+function PostMessage(data) {
+ plugin = document.getElementById('plugin');
+ plugin.postMessage('testing123', '');
nasko 2012/09/19 21:19:59 The second param is the target origin, right? If y
+}
</script>
<object id="plugin"
@@ -16,3 +20,15 @@ function SetSize(w, h) {
width="640"
height="480"
border="0px"></object>
+<script type="text/javascript">
+var msg;
+function receiveMessage(event) {
+ msg = event.data;
+ if (msg != 'stop_ack') {
nasko 2012/09/19 21:19:59 Shouldn't that be !==?
Fady Samuel 2012/09/20 15:24:28 Done.
+ event.source.postMessage('stop', '*');
+ } else {
+ window.document.title = 'stop_ack';
+ }
+}
+document.getElementById('plugin').addEventListener('message', receiveMessage, false);
+</script>

Powered by Google App Engine
This is Rietveld 408576698