Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject HTML differently. #31

Open
Quafadas opened this issue Jun 26, 2024 · 0 comments
Open

Inject HTML differently. #31

Quafadas opened this issue Jun 26, 2024 · 0 comments

Comments

@Quafadas
Copy link
Owner

Quafadas commented Jun 26, 2024

On "Providing you own html" you can instead of asking to put the script tag with the code, you could serve yourself from the code the script code:

      const sse = new EventSource("/refresh/v1/sse");
      sse.addEventListener("message", (e) => {
        const msg = JSON.parse(e.data);

        if ("KeepAlive" in msg) console.log("KeepAlive");

        if ("PageRefresh" in msg) location.reload();
      });

in a special path..
Like:
/script/live-server.js

And then ask the users to add:
<script src="/scripts/live-server.js" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant