您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fix bugs in Notion
当前为
- // ==UserScript==
- // @name Notion Fix
- // @namespace https://github.com/alanleungcn/notion-fix
- // @version 1.3
- // @author Alan Leung
- // @description Fix bugs in Notion
- // @match https://www.notion.so/*
- // @license MIT
- // ==/UserScript==
- (function () {
- 'use strict';
- let preView = null;
- let curView = null;
- const checkInterval = 100;
- const viewList = [
- 'table',
- 'board',
- 'timeline',
- 'calendar',
- 'gallery',
- 'list',
- ];
- const init = setInterval(() => {
- queryView();
- if (curView) {
- clearInterval(init);
- applyFix();
- fixFirefoxScrollbarWidth();
- }
- }, checkInterval);
- window.addEventListener('click', () => {
- applyFix();
- });
- // function fixTimelineDividerPosition() {
- // document.querySelector('.pseudoSelection').style.position = '';
- // }
- function fixScrollbarPosition() {
- document.querySelector(
- '.notion-scroller.vertical.horizontal'
- ).scrollLeft = 0;
- }
- function fixFirefoxScrollbarWidth() {
- const style = document.createElement('style');
- style.textContent = `.notion-scroller { scrollbar-width: thin }`;
- document.head.append(style);
- }
- function queryView() {
- viewList.forEach((view, i) => {
- if (document.querySelector(`.notion-${view}-view`)) {
- curView = viewList[i];
- }
- });
- }
- function applyFix() {
- requestAnimationFrame(() => {
- queryView();
- // if (curView === 'timeline') {
- // fixTimelineDividerPosition();
- // }
- if (curView !== preView && preView === 'timeline') {
- fixScrollbarPosition();
- }
- preView = curView;
- });
- }
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址