We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2676357 commit 42269c9Copy full SHA for 42269c9
youtube.com/index.js
@@ -2,8 +2,8 @@
2
* Show channel ID on pages that use "pretty" URLS
3
*/
4
if (
5
- /^\/(?:c|user)\//.test(location.pathname) ||
6
- document.getElementById("channel-header")
+ /^\/(?:c|user|@)\/?/.test(location.pathname) ||
+ document.getElementById("page-header")
7
) {
8
const chanId = document.createElement("a");
9
const meta = ytInitialData.metadata.channelMetadataRenderer;
@@ -14,5 +14,9 @@ if (
14
const p = document.createElement("p");
15
p.appendChild(chanId);
16
17
- document.querySelector("div.ytd-channel-name").appendChild(p);
+ setTimeout(() => {
18
+ document
19
+ .querySelector(".yt-page-header-view-model__page-header-title")
20
+ .nextElementSibling.prepend(p);
21
+ }, 1500); // wait for the header to load
22
}
0 commit comments