| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <script> | 3 <script src="flash.js"></script> |
| 4 function triggerPrompt() { | |
| 5 document.getElementById('flash-link').click(); | |
| 6 window.domAutomationController.send(true); | |
| 7 } | |
| 8 | |
| 9 function triggerPromptViaNewWindow() { | |
| 10 document.getElementById('flash-new-window-link').click(); | |
| 11 window.domAutomationController.send(true); | |
| 12 } | |
| 13 | |
| 14 function flashIsEnabledForPlugin(plugin) { | |
| 15 plugin.addEventListener('message', function handleEvent(event) { | |
| 16 if (event.data.source === 'getPowerSaverStatusResponse') { | |
| 17 plugin.removeEventListener('message', handleEvent); | |
| 18 window.domAutomationController.send(true); | |
| 19 } | |
| 20 }); | |
| 21 if (plugin.postMessage) | |
| 22 plugin.postMessage('getPowerSaverStatus'); | |
| 23 else | |
| 24 window.domAutomationController.send(false); | |
| 25 } | |
| 26 | |
| 27 function flashIsEnabled() { | |
| 28 flashIsEnabledForPlugin(document.getElementById('flash-object')); | |
| 29 } | |
| 30 | |
| 31 function flashIsEnabledForPluginWithoutFallback() { | |
| 32 flashIsEnabledForPlugin( | |
| 33 document.getElementById('flash-object-no-fallback')); | |
| 34 } | |
| 35 </script> | |
| 36 <body> | 4 <body> |
| 37 <object id="flash-object-no-fallback" data="test.swf" | 5 <object id="flash-object-no-fallback" data="test.swf" |
| 38 type="application/x-shockwave-flash" width="400" height="100"> | 6 type="application/x-shockwave-flash" width="400" height="100"> |
| 39 </object> | 7 </object> |
| 40 <object id="flash-object" data="test.swf" | 8 <object id="flash-object" data="test.swf" |
| 41 type="application/x-shockwave-flash" width="400" height="100"> | 9 type="application/x-shockwave-flash" width="400" height="100"> |
| 42 Flash not supported. | 10 Flash not supported. |
| 43 <br> | 11 <br> |
| 44 <a href="https://get.adobe.com/flashplayer/" id="flash-link"> | 12 <a href="https://get.adobe.com/flashplayer/" id="flash-link"> |
| 45 Download Flash. | 13 Download Flash. |
| 46 </a> | 14 </a> |
| 47 <a id="flash-new-window-link" | 15 <a id="flash-new-window-link" |
| 48 onclick="window.open('https://get.adobe.com/flashplayer/');"> | 16 onclick="window.open('https://get.adobe.com/flashplayer/');"> |
| 49 Download Flash window.open | 17 Download Flash window.open |
| 50 </a> | 18 </a> |
| 51 </object> | 19 </object> |
| 52 </body> | 20 </body> |
| 53 </html> | 21 </html> |
| OLD | NEW |