liskin / strava-map-switcher

Map switcher for Strava website
GNU General Public License v3.0
71 stars 20 forks source link

Map Switcher breaks Personal Heatmaps #13

Closed nixxcz closed 4 years ago

nixxcz commented 4 years ago

When Map Switcher is enabled, Personal Heatmaps (subscription feature) won't load.

Steps to reproduce:

  1. Go to https://www.strava.com/athlete/heatmaps (paid Strava subscription required)
  2. Generate a personal heatmap
  3. Visit the heatmap (e.g. https://www.strava.com/athletes/{id}/heatmaps/{key})
  4. The heatmap won't load. JavaScript console displays the following errors:
    You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
    Unchecked runtime.lastError: The message port closed before a response was received.
  5. When Map Switcher is disabled, the heatmap loads and error messages are not displayed
liskin commented 4 years ago

I can't reproduce this (I do have trial membership and a personal heatmap but the extension doesn't break it) but I'll try to fix this somehow and let you test it. Will you be able to test a patch locally?

nixxcz commented 4 years ago

Sure, I'll be happy to test. It puzzles me that you can't repro. I'm thinking maybe it could be some interaction between AdBlock, Elevate extension for Strava or some other extension I'm using. I'm not at my PC now to test.

liskin commented 4 years ago

Yeah, interaction with another extension would be my first guess, too. (I won't get to attempting to fix this until Tuesday.)

nixxcz commented 4 years ago

It seems there's some sort of race condition when loading a Personal Heatmap. When I disable all extensions, the Personal Heatmap seems to load fine each time. When I enable strava-map-switcher and keep hitting F5 (in Chrome), the map sometimes does't load (and sometimes it does).

liskin commented 4 years ago

Tried it again today and using shift-reload I could reproduce it fairly often. Pushing a fix.

mefjuu commented 2 years ago

This issue still occurs. At least on StrViewer extension that is based on strava-map-switcher (as far as the docs say).

liskin commented 2 years ago

This issue still occurs. At least on StrViewer extension that is based on strava-map-switcher (as far as the docs say).

"based on" in this context really just means they took my code. There's absolutely nothing I can do here to fix any problems you're having with StrViewer.