Skip to content

[Bug]: Filtered messages disappear on page refresh #8

@spadou

Description

@spadou

Checklist

  • This is an issue for YtcFilter, not LiveTL or HyperChat. I will go to the LiveTL repo to report an issue with LiveTL, or the HyperChat repo to report an issue with HyperChat.
  • This issue is not a matter of opinion. If it is, I will use the feature suggestion issue template.
  • I have checked for a duplicate or similar issue. I made sure to check closed issues as well.
  • I am still able to reproduce the issue after I reinstall the extension.
  • I have clear instructions to reproduce the bug, even on another machine.
  • I am not suggesting a feature. If I am, I will use the feature suggestion issue template.
  • By submitting this issue, you agree to follow our Code of Conduct

Describe the bug

When the live stream page is refreshed, messages already filtered before the refresh are no longer visible when ytcfilter reopen.

Steps To Reproduce

  1. Open a live stream and wait for some messages to be filtered and displayed in ytcfilter.
  2. Refresh the page.

Expected behavior

Previously filtered messages should still be visible after a refresh.

What browsers are you seeing the problem on?

Chrome

Anything else?

If I look in archives in ytcfilter settings I can see the messages previously filtered, but there is no video id or title (which I think is the cause of the refresh issue).

Looking a bit at the code, I see the chat-interceptor.ts is supposed to get video/channel info, but fail with "Cannot read properties of undefined (reading '__dataHost')". It looks like the following property is no longer available (window as any).parent.yt.config_.SBOX_SETTINGS.SEARCHBOX_COMPONENT, not sure why but maybe a change on youtube side.

I checked if this was available elsewhere and found another property in the window ytInitialData that looks promising. I think that changing the code that get video/channel info to use (window as any).parent.ytInitialData.contents.twoColumnWatchNextResults... instead may work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions