Skip to content

Instantly share code, notes, and snippets.

@gabemarshall
Created November 24, 2015 00:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabemarshall/fa42b2d3be816b8a694f to your computer and use it in GitHub Desktop.
Save gabemarshall/fa42b2d3be816b8a694f to your computer and use it in GitHub Desktop.
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