-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Chrome: Opening a Twitter tab in background for 10 seconds causes script to fail #198
Comments
Under normal circumstances, this should be a negligible increase in the timeout, but if this tab is in the background, this rAF will delay until it has focus. Fixes insin#198.
Would just removing the timeout altogether fix this? If Twitter ever change their implementation so the one specific element you currently need to look at to determine whether it's in mobile or desktop mode is no longer there, 99.9% of users aren't going to notice the logged message anyway, so the result is still just "Tweak New Twitter broke". |
Looks like just removing the timeout will work - it seems to get the app wrapper immediately if you're not logged in and waits for |
Yep, removing the timeout altogether would fix it too. You bring up a good point re: "what if
|
- Fixed Tweak New Twitter not working if you open Twitter in a background tab then switch to it some time later [#198]
Thanks for the bug report - the current plan for that is still "I see it when I check Twitter and fix it as quickly as possible" 😸 Put this in as a quick fix but will swing back around to this after I'm finished getting the Safari versions ready. |
I have a fix at #199 which adds a rAF to the timeout, which also fixes this issue if you wanted to use a timeout in the future. Feel free to close that if it's not necessary. |
This issue occurs with both the Chrome extension (version 2.22.0) and the UserScript (version 88). Tested on a clean Chrome profile.
With Chrome 109, opening a Twitter page in the background, and waiting a few seconds before switching to the tab, causes Tweak New Twitter to not be injected. The culprit seems to be these lines:
https://github.com/insin/tweak-new-twitter/blob/62625cdfb562d3978847393637355288f7cd12c3/tweak-new-twitter.user.js#L3289-L3296
I suspect that Tweak New Twitter is being run, but the actual DOM isn't rendered until the user switches to the tab. Interestingly, Chrome renders the tab without a
<title>
, just the URL:and it seems like hovering over the tab to activate Chrome's tab preview causes the DOM and
<title>
to be rendered.The text was updated successfully, but these errors were encountered: