tzhf / chatguessr

A Twitch chatbot for GeoGuessr.
https://chatguessr.com
MIT License
39 stars 12 forks source link

Improve hijackMap to work better with reloads #4

Closed ReAnnannanna closed 2 years ago

ReAnnannanna commented 2 years ago

I think this code was relying on being run before the GeoGuessr page loaded. After PR #3, the renderer code is injected during/after the load, so the page may already be ready. With these changes, we also synchronously check for the existence of the google maps API script tag as soon as the script is ran, so it can immediately resolve if it was already there.