您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Stops underscores from being converted into italics in the Outlook message editor.
// ==UserScript== // @name Fix underscores in Outlook // @namespace http://tampermonkey.net/ // @author yotann // @version 0.1 // @license CC-PDDC // @description Stops underscores from being converted into italics in the Outlook message editor. // @match https://outlook.office.com/* // @grant none // ==/UserScript== (function() { 'use strict'; function hookPrototype(prototype, overrides) { // Set the prototype of the overrides, so `super` refers to an unmodified copy of the original prototype. Object.setPrototypeOf(overrides, Object.create(Object.getPrototypeOf(prototype), Object.getOwnPropertyDescriptors(prototype))); Object.defineProperties(prototype, Object.getOwnPropertyDescriptors(overrides)); } // Javascript modules are lazily loaded using webpack chunks. // Detect when a new chunk is loaded, so we can find the module that includes MarkdownPlugin. hookPrototype(globalThis.webpackChunkOwa, { push(array) { const moduleConstructors = array[1]; Object.entries(moduleConstructors).forEach(([id, originalModuleConstructor]) => { moduleConstructors[id] = function(module, exports, exporter) { originalModuleConstructor.apply(this, arguments); if (exports.hasOwnProperty('MarkdownPlugin')) { console.log('Patching MarkdownPlugin'); hookPrototype(exports.MarkdownPlugin.prototype, { initialize(editor) { super.initialize(editor); this.options.italic = false; // "_" // this.options.bold = false; // "*" // this.options.strikethrough = false; // "~" // this.options.codeFormat = false; // "`" } }); } }; }); super.push(array); } }); })();