I have an EventSource that does nothing initially:
var source = new EventSource('{{do_nothing}}');
Then I trigger something in my flask backend and it changes my 'do_nothing' to a server sent event:
var source = new EventSource('/my_event');
and this server sent event will start sending (yielding) data where my source will pick it up and do stuff:
source.onmessage = function(event) { get(event.data) do stuff }
however if I leave the webpage; and return to the web page again, or open up the web page in another browser the event is no longer occurring on the newly opened page.
How do I make it so if I return to the same page that I will continue to get the output of the server sent event until the server sent event completes itself?