PageSourceSearch

https://bookai.top/scripts/youtube-subscribe.js

js bookai.top collected 2026-09-24 10:40:58 UTC 1,041 bytes, 19 lines download raw bytes

1window.addEventListener('load', function() {
2  const sidebarElement = document.querySelector('.theme-doc-sidebar-container');
3  if (sidebarElement) {
4    const subscribeDiv = document.createElement('div');
5    subscribeDiv.style.padding = '15px';
6    subscribeDiv.innerHTML = '<div class="g-ytsubscribe" data-channelid="UCzbSuf_A_D8dARJ33HzoDew" data-layout="full" data-count="default"></div>';
7    sidebarElement.insertBefore(subscribeDiv, sidebarElement.firstChild);
8
9    // 只有真的插入了订阅组件时,才去加载渲染它需要的 Google platform.js(约24KB)。
10    // 之前这个脚本是全站加载的,但只有带侧边栏的文档页会用到它,首页等
11    // 页面加载了完全用不上。避免重复注入。
12    if (!document.querySelector('script[src="https://apis.google.com/js/platform.js"]')) {
13      const gscript = document.createElement('script');
14      gscript.src = 'https://apis.google.com/js/platform.js';
15      gscript.async = true;
16      document.body.appendChild(gscript);
17    }
18  }
19}); 

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.