mirror of
https://github.com/YouG-o/YouTube-No-Translation.git
synced 2026-04-25 01:56:01 +03:00
[PR #56] [MERGED] Refact/titles #122
Labels
No labels
ToDo
bug
enhancement
enhancement
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/YouTube-No-Translation#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/YouG-o/YouTube-No-Translation/pull/56
Author: @YouG-o
Created: 7/5/2025
Status: ✅ Merged
Merged: 7/5/2025
Merged by: @YouG-o
Base:
main← Head:refact/titles📝 Commits (9)
d343f84refactor: extract video ID parsing logic to util function extractVideoIdFromUrle420397refactor: extract browsing title element validation logic to shouldProcessBrowsingElement.e62a7c0refactor: extract browsing title element state check logic to checkElementProcessingStateb5611c2refactor: extract original title fetching logic to fetchOriginalTitle function707a0d3refactor: use extractVideoIdFromUrl utility in shorts titles processingd9356b7refactor: use fetchOriginalTitle for notification popup titles5a39148refactor: extract and use fetchMainTitle for main, embed, and miniplayer title retrieval9910aa8refactor: use extractVideoIdFromUrl utility in notification title processingb26d99arefactor: unify shorts title retrieval logic using fetchMainTitle and fetchOriginalTitle📊 Changes
7 files changed (+423 additions, -438 deletions)
View changed files
📝
CHANGELOG.md(+11 -0)📝
src/content/titles/browsingTitles.ts(+265 -236)📝
src/content/titles/mainTitle.ts(+72 -106)📝
src/content/titles/notificationTitles.ts(+9 -44)📝
src/content/titles/shortsTitles.ts(+15 -52)➕
src/content/utils/video.ts(+31 -0)📝
src/types/types.ts(+20 -0)📄 Description
Refactor YouTube title retrieval logic
This PR centralizes and unifies all logic related to YouTube title extraction and restoration.
Common code is now shared across browsing, shorts, notifications, and main video titles, making the codebase much easier to maintain and test.
All features have been tested in real conditions and work as expected.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.