Last active
December 15, 2015 19:29
-
-
Save dodikk/5311895 to your computer and use it in GitHub Desktop.
Javascript injection stopped working in iOS 6.1
This file contains 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
function createScriptElementWithWebPlugins() { | |
var headID = document.getElementsByTagName("HEAD")[0]; | |
var newScript = document.createElement('script'); | |
newScript.type = 'text/javascript'; | |
newScript.onload=function(){ | |
//scmobile.device.name = 'Igor's iPhone'; // JS interpreter error | |
scmobile.device.name = unescape( 'Igor%27s%20iPhone' ); | |
alert( scmobile.device.name ); // Shows |Igor's iPhone| | |
scmobile.device.uuid = 'XXXXXXXXX'; | |
scmobile.device.version = '6.1.2'; | |
scmobile.device.socketPort = 'XXXXX'; | |
scmobile.device.__fireDeviceReady(); | |
}; | |
newScript.src = 'scmobile://localhost:33445/var/mobile/Applications/37A95597-C552-4EE3-A297-47C044E17AC7/Documents/scmobile_main.js'; | |
return headID.appendChild(newScript); | |
} | |
createScriptElementWithWebPlugins(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment