Created
September 25, 2015 09:14
-
-
Save sghiassy/43c25dbc6382f950277a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| executeApplicationScript: function(message, sendReply) { | |
| for (var key in message.inject) { | |
| window[key] = JSON.parse(message.inject[key]); | |
| } | |
| loadScript(message.url, sendReply.bind(null, null)); | |
| } | |
| function loadScript(src, callback) { | |
| var script = document.createElement('script'); | |
| script.type = 'text/javascript'; | |
| script.src = src; | |
| script.onload = callback; | |
| document.head.appendChild(script); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment