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


让网页使用浏览器设置的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...
})();


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM