Skip to content

Instantly share code, notes, and snippets.

@jbuda
Created July 31, 2014 07:54
Show Gist options
  • Save jbuda/0d28a712481135ff5944 to your computer and use it in GitHub Desktop.
Save jbuda/0d28a712481135ff5944 to your computer and use it in GitHub Desktop.
Weinre android js script injection without having to change the physical html
webView.loadUrl(
"javascript:"+
"var script = document.createElement('script'); "+
"script.type = 'text/javascript'; "+
"script.src = 'http://XXXXXXXXX:XXXX/target/target-script-min.js#anonymous'; "+
"document.getElementsByTagName('head')[0].appendChild(script); "
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment