Created
November 24, 2015 00:50
-
-
Save gabemarshall/fa42b2d3be816b8a694f 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
class InjectJS < Proxy::Module | |
def on_request( request, response ) | |
if response.content_type =~ /^text\/html.*/ | |
if response.headers =~ /MSIE/ | |
response.body.sub!( '</title>', "</title><script type='text/javascript'></script>" ) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment