'use strict'; /* global self */ var url = require('url'); var getCurrentScriptSource = require('./getCurrentScriptSource'); function createSocketUrl(resourceQuery, currentLocation) { var urlParts; if (typeof resourceQuery === 'string' && resourceQuery !== '') { // If this bundle is inlined, use the resource query to get the correct url. // format is like `?http://0.0.0.0:8096&sockPort=8097&sockHost=localhost` urlParts = url.parse(resourceQuery // strip leading `?` from query string to get a valid URL .substr(1) // replace first `&` with `?` to have a valid query string .replace('&', '?'), true); } else { // Else, get the url from the