youtube icon indicating copy to clipboard operation
youtube copied to clipboard

Fix video owner channel link after SPA navigation

Open OnlyYu1996 opened this issue 6 months ago • 3 comments

Summary

  • refresh the cached watch-page owner channel elements during video page updates
  • restore the current owner link from YouTube renderer endpoint data before applying the default channel tab rewrite
  • add a regression test for reused owner link nodes retaining a previous channel URL

Fixes #1485

Tests

  • npm ci
  • npx jest tests/unit/video-owner-channel-link.test.js --runInBand
  • npx jest tests/unit/watch-later-buttons.test.js tests/unit/popup-preview-button.test.js tests/unit/remaining-duration.test.js tests/unit/video-owner-channel-link.test.js --runInBand
  • ESLINT_USE_FLAT_CONFIG=true npx eslint --config tests/eslint_rules.config.mjs tests/unit/video-owner-channel-link.test.js
  • node --check js&css/web-accessible/functions.js && node --check tests/unit/video-owner-channel-link.test.js
  • git diff --check

Note: running ESLint over the full existing js&css/web-accessible/functions.js still reports pre-existing style issues outside this patch.

OnlyYu1996 avatar May 18 '26 03:05 OnlyYu1996

  1. Why was this added (years ago) without depending on a feature being enabled?
    (should probably not. Did it fix a Youtube Bug before ?)

else if (name === 'YTD-VIDEO-SECONDARY-INFO-RENDERER') { this.elements.yt_channel_name = node.querySelector('ytd-channel-name'); this.elements.yt_channel_link = node.querySelector('ytd-channel-name a');

  1. How did #1485 happen?

ImprovedTube2 avatar May 18 '26 04:05 ImprovedTube2

因项目不接受 AI 辅助贡献,主动关闭此 PR。抱歉打扰。

OnlyYu1996 avatar May 18 '26 07:05 OnlyYu1996

hi @OnlyYu1996 didn't say so. You can add disclosure. And tune your system or make it semi-automated in the meantime.

ImprovedTube2 avatar May 18 '26 19:05 ImprovedTube2