youtube
youtube copied to clipboard
Fix video owner channel link after SPA navigation
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 cinpx jest tests/unit/video-owner-channel-link.test.js --runInBandnpx 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 --runInBandESLINT_USE_FLAT_CONFIG=true npx eslint --config tests/eslint_rules.config.mjs tests/unit/video-owner-channel-link.test.jsnode --check js&css/web-accessible/functions.js && node --check tests/unit/video-owner-channel-link.test.jsgit diff --check
Note: running ESLint over the full existing js&css/web-accessible/functions.js still reports pre-existing style issues outside this patch.
- 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');
- How did #1485 happen?
ĺ› éˇąç›®ä¸ŤćŽĄĺŹ— AI 辅助贡献,主动关é—㤠PR。抱ć‰ć‰“扰。
hi @OnlyYu1996 didn't say so. You can add disclosure. And tune your system or make it semi-automated in the meantime.