Skip to content

Instantly share code, notes, and snippets.

@zwpp
Last active June 14, 2023 17:59
Show Gist options
  • Save zwpp/ef0501f3a42ec1940887af9d1b3ea850 to your computer and use it in GitHub Desktop.
Save zwpp/ef0501f3a42ec1940887af9d1b3ea850 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name YouTube live light-weight emoji picker
// @namespace http://zwpp.me/
// @version 0.1
// @description Remove generic emoji from emoji picker and remove notificatioin for Subscribers-only chat
// @author zwpp
// @match https://www.youtube.com/live_chat*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let actionPanel =
[
window.ytInitialData.continuationContents?.liveChatContinuation.actionPanel,
window.ytInitialData.contents?.liveChatRenderer.actionPanel
].find(ap => ap)
if(!actionPanel) {
return;
}
// remove notification for Subscribers-only chat
delete actionPanel.liveChatMessageInputRenderer?.onInitialFocusCommand;
// remove Unicode emoji from emojiPicker
let emojiPickerRenderer = actionPanel.liveChatMessageInputRenderer.pickers.find(obj=> obj.emojiPickerRenderer)?.emojiPickerRenderer;
if(!emojiPickerRenderer) {
return;
}
emojiPickerRenderer.categories =
emojiPickerRenderer.categories.filter(
function (obj){
let categoryRenderer = obj.emojiPickerCategoryRenderer;
if (!categoryRenderer) return true;
return categoryRenderer.categoryId.startsWith("UC");
});
document.getElementById("search-panel").remove();
document.getElementById("category-buttons").remove();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment