Open reclaimingmytime opened 2 years ago
nice investigative work!
@elreydetoda : closed because solved by #425?
Yes, @ChanceM 's #425 solved this by doing a query on each page to see if the liveStream id is present. Explained here: https://github.com/JupiterBroadcasting/jupiterbroadcasting.com/pull/425#pullrequestreview-1121249814
Thinking about this again for a second, technically the #425 didn't "solve" every page loading the JS. It's just preventing the error from happening by checking if the expected embed element exists and only setting the .src
attrib (which was causing the error) if it does.
So, I'd say it technically patched the issue not solved 😅
Thinking about this again for a second, technically the #425 didn't "solve" every page loading the JS. It's just preventing the error from happening by checking if the expected embed element exists and only setting the
.src
attrib (which was causing the error) if it does.So, I'd say it technically patched the issue not solved 😅
Yeah the JB live is tied into this so rather than unravel them I just fixed it from attempting to set the src when the element wasn't on the page.
I think a better way is to detect the page it is going to be included in, and not including it in pages it shouldn't be on.
I'll actually re-open this since it's not fully remediated then. Just so we don't lose track of doing a "proper" fix for it.
I'll actually re-open this since it's not fully remediated then. Just so we don't lose track of doing a "proper" fix for it.
I mean technically we could remove a few lines and copy the rest to another file, but then we would need to maintain the same code in two places, as the same query for the live show embed is used to mark the live menu item. I think this is a sane half measure to eliminate the error and either not maintain the code twice or add another file request to the pages.
When I look at the browser console on any page other than the live page (e.g. https://new.jupiterbroadcasting.com/sponsors/), I get the following error:
It seems to be that the code embedded in the jb-tube.html partial is included on every page, not just the live page.
https://github.com/JupiterBroadcasting/jupiterbroadcasting.com/blob/3216265083a3ea39b98950cc1443e49c4a981962/themes/jb/layouts/partials/live/jb-tube.html#L1