Greasy Fork is available in English.
在用户菜单中添加番剧订阅快速入口
当前为
// ==UserScript== // @name Bilibili番剧订阅入口 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 在用户菜单中添加番剧订阅快速入口 // @author 落地开花([email protected]) // @match *://www.bilibili.com/* // @grant none // @run-at document-end // ==/UserScript== (function($) { 'use strict'; if (!$) return; var findIDFromCookie = function() { var cookies = document.cookie; return cookies.match(/DedeUserID=(\d+)/)[1]; }; var findProfileInfo = function($) { return $('li.nav-item.profile-info'); }; var insertBangumiItem = function($, $anchor) { $anchor.bind("DOMNodeInserted", function(e) { e.preventDefault(); var self = $(this), userId = findIDFromCookie(); self.unbind('DOMNodeInserted'); var aLink = $('<a></a>'); var aIcon = $('<i></i>').addClass('bili-icon b-icon-p-member'); aLink.text('番剧订阅') .prop('target', '_blank') .attr('href', '//space.bilibili.com/' + userId + '/#/bangumi') .prepend(aIcon); self.find('.member-menu ul.clearfix li:last-child').append(aLink); }); }; var init = function() { var profileInfo = findProfileInfo($); if (profileInfo.length > 0) { insertBangumiItem($, profileInfo); } else { setTimeout(init, 500); } }; $(init); })(window.$);