Extract connection.js from xs.js