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

Chat embed breaks Back button #129

Closed
kaldune opened this issue Jun 2, 2020 · 4 comments
Closed

Chat embed breaks Back button #129

kaldune opened this issue Jun 2, 2020 · 4 comments
Labels
product: embeds Twitch embeds (video or chat)

Comments

@kaldune
Copy link

kaldune commented Jun 2, 2020

Brief description

After the chat embed loads, it inappropriately adds the current page to the browser history. This usually breaks the Back button but not always. Sometimes the browser detects the duplicate history and navigates back correctly. When the Back button breaks, the experience is terrible.

How to reproduce

  1. Open Chrome, Edge or Firefox

  2. Navigate to one of the following and wait for chat to fully load:
    https://www.twitch.tv/embed/rifftrax/chat
    https://codesandbox.io/s/dazzling-gates-y7wnt

  3. Hit the refresh button and wait for the chat to load again. Repeat this a few times. The chat embed keeps pushing the current page into the browser history.

Expected behavior

Chat embed should not alter browser history.

Screenshots
image

Additional context or questions
N/A

@kaldune kaldune changed the title Chat embed breaks back button Chat embed breaks Back button Jun 2, 2020
@kaldune
Copy link
Author

kaldune commented Jun 2, 2020

There's a history.push in the embed that might cause the issue.

https://static.twitchcdn.net/assets/pages.embed-chat-b5a0efdcd9e88ffd5fe5.js

        function g(e, n, t, i) {
            var r = i || v(n)
              , o = "";
            r && (o = "?" + m + "=" + function(e) {
                switch (e) {
                case d.a.VIEWS:
                    return a.Popular;
                case d.a.TIME:
                    return a.Newest;
                default:
                    return e
                }
            }(r));
            var s = t ? t.toLowerCase() : function(e) {
                var n = b(e);
                return n ? n.toLowerCase() : "all"
            }(n);
            c.p.history.push(e + "/" + s + o)
        }

@kaldune kaldune changed the title Chat embed breaks Back button Chat embed adds current page to browser history Jun 2, 2020
@kaldune kaldune changed the title Chat embed adds current page to browser history Chat embed messes up browser history Jun 2, 2020
@kaldune kaldune changed the title Chat embed messes up browser history Chat embed breaks the browser's Back button Jun 2, 2020
@kaldune kaldune changed the title Chat embed breaks the browser's Back button Chat embed breaks Back button Jun 2, 2020
@mzmiric5
Copy link

mzmiric5 commented Jun 3, 2020

I noticed a similar issue (although, was only able to reproduce it when embedding chat in addition to a player embed on the same page). I posted on the forums about it yesterday ( https://discuss.dev.twitch.tv/t/twitch-stream-and-chat-embed-hijacking-parent-navigation/26059 ), though I might add a +1 here

@kaldune
Copy link
Author

kaldune commented Jun 24, 2020

This might be fixed. I haven't been able to reproduce the issue for almost 3 weeks.

@lleadbet lleadbet added the product: embeds Twitch embeds (video or chat) label Jul 14, 2020
@lleadbet
Copy link
Contributor

@kaldune - We believe we addressed this, but if you continue to see this happening, please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: embeds Twitch embeds (video or chat)
Projects
None yet
Development

No branches or pull requests

3 participants