OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <head> | |
3 <title>Initial Title</title> | |
4 <script> | |
5 function PluginCreated() { | |
6 document.title = "Loaded"; | |
7 } | |
8 | |
9 function injectPlugin() { | |
10 var child = document.createElement('div'); | |
11 child.innerHTML = '<embed type="application/vnd.npapi-test" src="foo"' + | |
Will Harris
2014/10/17 18:57:08
nit: tab here.
| |
12 ' name="invoke_js_function_on_create" id="plugin"' + | |
13 ' mode="np_embed"></embed>'; | |
14 document.getElementById('content').appendChild(child); | |
15 // Plugins are loaded synchronously during layout, so the plugin has either | |
16 // been loaded or blocked at this point. | |
17 var plugin = document.getElementById('plugin'); | |
18 // Check for the "loadedProperty" to determine if plugin is loaded. | |
19 if (plugin.loadedProperty == true) { | |
20 document.title = "Loaded"; | |
21 } else { | |
22 document.title = "Not Loaded"; | |
23 } | |
24 } | |
25 </script> | |
26 </head> | |
27 <body onload='injectPlugin();'> | |
28 <div id='content'></div> | |
29 </embed> | |
30 </body> | |
31 </html> | |
OLD | NEW |