diff --git a/README.md b/README.md index 9740001d4295965c4b38499fbf7c9583de7f81f3..5bf40f7f528c34e47d925c00ffb226550eb0c57c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Follow the develop instructions above (steps 1-3), then: Assuming that the build output (inside `/target`) is hosted at `<root>` (eg: chatterbox.element.io), copy and paste the following snippet before the closing `</body>` tag: ```html <script> - window.CONFIG_LOCATION = "path_to_config"; + window.CHATTERBOX_CONFIG_LOCATION = "path_to_config"; </script> <script src="<root>/parent/assets/parent.js" type="module" id="chatterbox-script"></script> ``` diff --git a/index.html b/index.html index 5b278a8b35ebb4f4a2082404654e1a03fe741f26..884aeb6012de19dc83c6a93462631489b3ad6780 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@ </div> </div> <script> - window.CONFIG_LOCATION = "./config.json"; + window.CHATTERBOX_CONFIG_LOCATION = "./config.json"; </script> <script src="./src/parent.ts" type="module" id="chatterbox-script"></script> </body> diff --git a/src/parent.ts b/src/parent.ts index 7a22a9fc1a869039782b741cc55a9bb074d20258..b41441809b392c6b71070788a7202ae208383254 100644 --- a/src/parent.ts +++ b/src/parent.ts @@ -52,9 +52,9 @@ function loadCSS() { function loadChatterboxIframe() { const iframe = document.createElement("iframe"); - const configLocation = (window as any).CONFIG_LOCATION; + const configLocation = (window as any).CHATTERBOX_CONFIG_LOCATION; if (!configLocation) { - throw new Error("CONFIG_LOCATION is not set"); + throw new Error("CHATTERBOX_CONFIG_LOCATION is not set"); } iframe.src = new URL("../chatterbox.html?config=" + configLocation, hostRoot).href; iframe.className = "chatterbox-iframe";