Greasy Fork

Greasy Fork is available in English.

Slowly 段落划分

自动对信件的段落进行划分,使段落间有明显的间隔更便于阅读。触发条件是鼠标点击或者键盘按键,一般情况下可以无感触发。

当前为 2021-02-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Slowly 段落划分
// @namespace   Slowly Segmentation
// @match       https://web.slowly.app/friend/*
// @grant       none
// @version     0.0.1
// @author      稻米鼠
// @created     2021/2/16 下午2:23:14
// @update      2021/2/16 下午2:23:14
// @description 自动对信件的段落进行划分,使段落间有明显的间隔更便于阅读。触发条件是鼠标点击或者键盘按键,一般情况下可以无感触发。
// ==/UserScript==
const segmentation = ()=>{
  if(window.location.hash && window.location.hash === '#Segmented') return
  if(!/friend\/\w+\/\w+\//.test(window.location.href)) return
  document.body.querySelector('#root .friend-Letter-wrapper .letter .modal-body > .pre-wrap').innerHTML = '<p>' + document.body.querySelector('#root .friend-Letter-wrapper .letter .modal-body > .pre-wrap').innerHTML.split(/\n+/).join('</p><p>')+'</p>'
  window.location.hash = '#Segmented'
}

window.addEventListener('click', segmentation)
window.addEventListener('keydown', segmentation)