Commit 6a5e3369 authored by Sean Hammond's avatar Sean Hammond

Merge pull request #3258 from hypothesis/live-reload-server-host

Make client test page load embed from same hostname as test page
parents 70b81486 1dbbd4a9
......@@ -38,9 +38,11 @@ function LiveReloadServer(port, appServer) {
<body>
<pre style="margin: 75px;">${changelogText()}</pre>
<script>
var appHost = document.location.hostname;
window.hypothesisConfig = function () {
return {
liveReloadServer: 'ws://localhost:${port}',
liveReloadServer: 'ws://' + appHost + ':${port}',
// Open the sidebar when the page loads
firstRun: true,
......@@ -52,8 +54,11 @@ function LiveReloadServer(port, appServer) {
window.location.reload();
}
});
var embedScript = document.createElement('script');
embedScript.src = '${appServer}/embed.js'.replace('localhost', appHost);
document.body.appendChild(embedScript);
</script>
<script src="${appServer}/embed.js"></script>
</body>
</html>
`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment