Skip to content

Add toggle to hide "Sign out" menu item#3782

Closed
pbcodesC wants to merge 0 commit intocode-charity:masterfrom
pbcodesC:master
Closed

Add toggle to hide "Sign out" menu item#3782
pbcodesC wants to merge 0 commit intocode-charity:masterfrom
pbcodesC:master

Conversation

@pbcodesC
Copy link
Copy Markdown

Feature: Hide "Sign out" Option

Problem

There is currently no option to hide the "Sign out" item in the YouTube account menu.

Solution

Added a toggle setting that allows users to hide the "Sign out" menu item.

Implementation

  • Added checkbox toggle in settings UI
  • Stored preference using chrome.storage.sync
  • Implemented DOM-based filtering to hide the menu item
  • Used MutationObserver to handle dynamic menu rendering

Testing

Tested locally — works as expected when toggled.

Thank you!

Comment thread menu/index.html Outdated
<script src="skeleton-parts/dark-light-switch.js"></script>
<script src="skeleton-parts/refresh-categories.js"></script>
<script defer src="index.js"></script>
<label>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add code to save the checkbox state to chrome.storage.sync when toggled.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi ,updated :]

  • Persisted checkbox state using chrome.storage.sync
  • Applied the stored state to control visibility of the "Sign out" button
  • Ensured state is retained after reload

Please review it again,Thanks.

@ImprovedTube
Copy link
Copy Markdown
Member

ImprovedTube commented Apr 14, 2026

hi and thank you @pbcodesC @rajanarahul93

the description, commit and comment don't fit the extension, won't work.


One line of CSS can be enough here

(And another for the toggle in our menu skeleton.)
In this app, the placement in the menu is increasingly relevant to keep the whole tidy and be found by (mostly only) interested users)


Hiding menu items (all identified as #endpoint ?), each specific item may be identified through its SVG icon (#content-icon > yt-icon > span > div > svg > path) sign-out:
M19 2a2 2 0 012 2v16a2 2 0 01-2 2H9a1 1 0 010-2h10V4H9a1 1 0 010-2h10ZM9.293 7.293a1 1 0 000 1.414L11.586 11H4a1 1 0 000 2h7.586l-2.293 2.293a1 1 0 101.414 1.414L15.414 12l-4.707-4.707a1 1 0 00-1.414 0Z

  • The first X chars alone can be matched (even with CSS ^=) (enough to be unique. and little-enough for the chance to remain, even if YouTube edits this icon again.)

Matching the string "Sign out" wont help in other languages; where necessary - and to fall back to - we can put together a regex, including the common languages (including Korean) with Google/spreadsheets/Multi-Translator - or go for automatically getting translations from youtube (as was legendary done before #1752 @Lauviah0622)


https://github.com/code-charity/youtube/wiki/Contributing#Development


Thanks!

@ImprovedTube ImprovedTube added up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ Knowledge Base / Documentation for contributors We should repurpose this for future reference / Wiki / Education / Introduction labels Apr 14, 2026
@pbcodesC pbcodesC closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Art Generated Content Knowledge Base / Documentation for contributors We should repurpose this for future reference / Wiki / Education / Introduction up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants