您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
将notion页面中的第一个目录模块放在右侧并且可以隐藏,未隐藏时鼠标放在该区域可以滑动目录
当前为
// ==UserScript== // @name notion靠右悬浮目录 // @namespace https://www.notion.so/ // @description 将notion页面中的第一个目录模块放在右侧并且可以隐藏,未隐藏时鼠标放在该区域可以滑动目录 // @match https://www.notion.so/* // @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js // @grant none // @version 0.0.1.20240510111735 // ==/UserScript== (function () { 'use strict'; // Your code here... function addRightTOC(){ $("head").prepend(` <style> body { width: 100%; height: 100%; } .notion-table_of_contents-block { float: right; position: fixed !important; //height: 800px!important; // left: 0; top: 45px !important; // bottom: 0; right: 10px !important; z-index: 101 !important; width: 256px !important; overflow-y: scroll !important; -webkit-overflow-scrolling: touch !important; } #panel { float: right; position: fixed; top: 45px; right: 20px; z-index: 101; will-change: transform; } </style> `) $("body").prepend(` <main id="panel"> <header> <button class="toggle-button">☰</button> </header> </main> `) // Toggle button $('.toggle-button').on('click', function () { //updateOutline(); if (toc_open){ toc_open = false; $('#panel').css("right", "20px"); $(".notion-table_of_contents-block").hide(); }else{ toc_open = true; $('#panel').css("right", "276px"); $(".notion-table_of_contents-block").show(); //console.log($("#notion-app > div > div:nth-child(1) > div > div:nth-child(4) > main").height()-45); $(".notion-table_of_contents-block").height($("#notion-app").height()-45); } }); } let toc_open = false; window.addEventListener('load', function () { console.log(history); let max_search_ms = 10000 let timer_id = setInterval(function () { if ($(".notion-table_of_contents-block").length > 0) { $(".notion-table_of_contents-block").hide(); addRightTOC(); clearInterval(timer_id); } else { max_search_ms = max_search_ms-500 if (max_search_ms<500){ clearInterval(timer_id); } } }, 100); }, false); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址