diff --git a/src/LiveDevelopment/BrowserScripts/LivePreviewTransportRemote.js b/src/LiveDevelopment/BrowserScripts/LivePreviewTransportRemote.js index 49003c146..b749a24f7 100644 --- a/src/LiveDevelopment/BrowserScripts/LivePreviewTransportRemote.js +++ b/src/LiveDevelopment/BrowserScripts/LivePreviewTransportRemote.js @@ -93,9 +93,8 @@ // LivePreviewTransport.js:getRemoteScript() This is so that the actual live preview page doesnt get hold of // any phoenix web socket or broadcast channel ids from this closure programatically for security. - const TRANSPORT_CONFIG={}; //Replace dynamic section start - //REPLACE_ME_WITH_LIVE_PREVIEW_TRANSPORT_CONFIG_AND_SCRIPT_DYNAMIC + const TRANSPORT_CONFIG={}; //Replace dynamic section end function _debugLog(...args) { diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/LivePreviewTransport.js b/src/LiveDevelopment/MultiBrowserImpl/transports/LivePreviewTransport.js index 40a3c39c9..6c8af4cb6 100644 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/LivePreviewTransport.js +++ b/src/LiveDevelopment/MultiBrowserImpl/transports/LivePreviewTransport.js @@ -66,14 +66,15 @@ define(function (require, exports, module) { * @return {string} */ function getRemoteScript() { - const replaceString = "//REPLACE_ME_WITH_LIVE_PREVIEW_TRANSPORT_CONFIG_AND_SCRIPT_DYNAMIC"; + const replaceString = "const TRANSPORT_CONFIG={};"; if(!LivePreviewTransportRemote.includes(replaceString)){ throw new Error("Live preview transport is expected to have replaceable template string:" + " //REPLACE_ME_WITH_LIVE_PREVIEW_TRANSPORT_CONFIG_AND_SCRIPT_DYNAMIC"); } let transportScript = (_transportBridge && _transportBridge.getRemoteTransportScript && _transportBridge.getRemoteTransportScript()) || ""; - transportScript = `TRANSPORT_CONFIG.PHOENIX_INSTANCE_ID = "${Phoenix.PHOENIX_INSTANCE_ID}";\n` + + transportScript = "const TRANSPORT_CONFIG={};" + + `TRANSPORT_CONFIG.PHOENIX_INSTANCE_ID = "${Phoenix.PHOENIX_INSTANCE_ID}";\n` + `TRANSPORT_CONFIG.LIVE_DEV_REMOTE_WORKER_SCRIPTS_FILE_NAME = "${LiveDevProtocol.LIVE_DEV_REMOTE_WORKER_SCRIPTS_FILE_NAME}";\n` + `TRANSPORT_CONFIG.LIVE_PREVIEW_DEBUG_ENABLED = ${logger.loggingOptions.logLivePreview};\n`+ transportScript;