油猴脚本修改网页默认字体

让网页使用浏览器设置的sans-serif字体,放在fontFamily前面的字体会被优先使用。参考:https://www.cnblogs.com/yaomumu/p/12759060.html
注意:

  1. @match要修改一下,匹配所有的网页
  2. font-family需要改写为驼峰形式fontFamily
// ==UserScript==
// @name         use sans-serif
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http*://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    /*document.body.style.backgroundColor = '#00ee00'*/
    //document.body.style.cssText += 'sans-serif';
    document.body.style.fontFamily='sans-serif';
    // Your code here...
})();
原文地址:https://www.cnblogs.com/reasoner/p/13389178.html