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

Version 1.2.2 hangs Firefox when using LiveTL in full-screen mode #733

Closed
shoaibshakeel381 opened this issue Aug 24, 2021 · 11 comments
Closed

Comments

@shoaibshakeel381
Copy link

shoaibshakeel381 commented Aug 24, 2021

I usually watch youtube live streams with LiveTL extension. That extension shows chat in an iframe. Everything use to work fine until 10ten was updated to 1.2.2. Now everytime it's starts to consume memory in GBs. Causing firefox to hang. I've tested everything with and without this extension and issue only happens in 1.2.2 version.

Does anyone knows what going on?

LiveTL extension: https://addons.mozilla.org/en-US/firefox/addon/livetl/
Sample Video: GameCon 2022: https://www.youtube.com/watch?v=3oWhc2yOtug

Layout: https://i.imgur.com/skAOtbv.jpg
the red cirle highlights the iframe

@birtles
Copy link
Member

birtles commented Aug 24, 2021

Hi! Firstly, thank you very much for filing this. It's a very helpful report.

Secondly, sorry about the inconvenience this has caused. Hanging is a very frustrating.

I'm going to look into this later today. I expect the changes to iframe handling are involved but I'm not sure yet what LiveTL is doing with iframes.

@birtles
Copy link
Member

birtles commented Aug 25, 2021

I think I have an idea what is going on. After a bit of debugging, it seems like we get stuck in an infinite loop sending and receiving clearResult messages.

When we get a clearResult message we call clearResult() which does:

if (isTopMostWindow()) {
this.hidePopup();
} else {
window.top.postMessage<ContentMessage>(
{ kind: '10ten(ja):clearResult' },
'*'
);
}

i.e. if it's not the top frame, posts the message to the top frame.

However, LiveTL has some code that simply takes any message sent to its top frame and forwards it to its watch.html iframe:

https://github.com/LiveTL/LiveTL/blob/ab5d2d8f8a5d13868528625692d9f01db30fb3bf/src/js/content_scripts/injector.js#L188-L190

As a result the clearResult message ends up back at the iframe and we go around again.

This could happen for other types of messages too, but so far I've observed it with clearResult. We should ensure we never send the same message that we receive.

@birtles
Copy link
Member

birtles commented Aug 25, 2021

Ok, I've fixed the hang now but that doesn't mean LiveTL works. LiveTL has the following setup:

  • LiveTL top window (moz-extension://... URL)
    • YouTube iframe (https://www.youtube.com/... URL)
      • LiveTL iframe (moz-extension://... URL)

However, content scripts don't get injected into moz-extension://... documents and I don't think we can peek into the inner iframe from the YouTube iframe either because it is cross-origin.

So I guess 10ten never worked for the chat window in LiveTL. @shoaibshakeel381 is that right?

@shoaibshakeel381
Copy link
Author

it did work. See the image for version 1.2.1
https://i.imgur.com/9ETq4Lk.jpg

@birtles
Copy link
Member

birtles commented Aug 25, 2021

it did work. See the image for version 1.2.1
https://i.imgur.com/9ETq4Lk.jpg

Oh that's odd. I installed 1.2.1 locally and it didn't work for me. Let me try again.

@birtles
Copy link
Member

birtles commented Aug 25, 2021

@shoaibshakeel381 I still can't get it to work with 1.2.1 and I don't understand how it would. Are we on the same version of LiveTL? 6.7.2? Are there any other add-ons that might be involved?

@birtles
Copy link
Member

birtles commented Aug 25, 2021

Hmm, I still can't get it to work with LiveTL 6.6.3. I wonder if it behaves differently when logged in.

@birtles birtles changed the title High memory usage in verion 1.2.2 hangs Firefox Version 1.2.2 hangs Firefox when using LiveTL in full-screen mode Aug 25, 2021
@birtles
Copy link
Member

birtles commented Aug 25, 2021

Never mind, I worked it out. You need to disable "Hyper chat". If you do that, it works in 1.2.1 etc. It doesn't work in 1.2.2 however so we'll need to fix that.

@birtles
Copy link
Member

birtles commented Aug 26, 2021

Version 1.2.3 is now available and should fix these issues.

@shoaibshakeel381
Copy link
Author

I've tested it and it works. Awesome work man. Seemed like an unreasonable request from me.

@birtles
Copy link
Member

birtles commented Aug 26, 2021

Thank you so much! Your comment now made it all worthwhile!
Thanks for using 10ten!

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

2 participants