Greasy Fork

Greasy Fork is available in English.

小米便签pdf导出工具

点击右上角打印按钮,打印本篇笔记。

当前为 2021-09-25 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         小米便签pdf导出工具
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  点击右上角打印按钮,打印本篇笔记。
// @author       aqni
// @match        https://i.mi.com/note/h5
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/jQuery.print.js
// @grant        none
// ==/UserScript==
(function(){
    /* globals $*/
    'use strict';
    const iconHTML='<i class="icon-8zlI5"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="1em" height="1em" fill="none"><path d="M14,15.3h4v-8H2v8h4V18h8v-5.3H6 M6,7.3V2.9C6,2.4,6.4,2,7,2h6c0.6,0,1,0.4,1,0.9v2.2" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/></svg></i>';
    const btnCreate=`<button class="action-2Jcj0 action-btn-3pa39">${iconHTML}</button>`;
    const posSelect="span.action-group-record-21ymU";
    const noteSelect="div.editor-body-VJW45";
    $(document).ready(function(){
        $(posSelect).before(
            $(btnCreate).click(function(){
                $(noteSelect).print();
            })
        );
    });
})();