OPPOSans

在网页中使用OPPOSans

  1. // ==UserScript==
  2. // @name OPPOSans
  3. // @namespace OPPOSans
  4. // @version 1
  5. // @description 在网页中使用OPPOSans
  6. // @author LWF
  7. // @license MIT
  8. // @grant none
  9. // @match *://*/*
  10. // @exclude *://fanqienovel.com/reader/*
  11. // @exclude *://*.android.google.cn/*
  12. // @exclude *://ai.qaqgpt.com/*
  13. // @run-at document-start
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. // 创建一个 <style> 元素
  18. const css = document.createElement('style');
  19. // 为 <style> 元素设置 CSS 内容,导入外部字体,并强制所有元素使用 OPPOSans 字体
  20. css.innerHTML = "@import url('https://www.oppo.com/etc.clientlibs/global-site/clientlibs/ui.frontend/clientlib-font-cn.min.6c9808838585702dbf33c24fc6ca0b48.css');*{font-family:OPPOSans-Medium!important;}";
  21. // 将 <style> 元素添加到页面的 <head> 部分
  22. document.head.appendChild(css);
  23. })();