Greasy Fork镜像 支持简体中文。

所有小写字母全部变大写

try to take over the world!

  1. // ==UserScript==
  2. // @name 所有小写字母全部变大写
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author none
  7. // @include http*
  8. // @include ftp
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.  
  14. function addCSS(cssText){
  15. var style = document.createElement('style'), //创建一个style元素
  16. head = document.head || document.getElementsByTagName('head')[0]; //获取head元素
  17. style.type = 'text/css'; //这里必须显示设置style元素的type属性为text/css,否则在ie中不起作用
  18. if(style.styleSheet){ //IE
  19. var func = function(){
  20. try{ //防止IE中stylesheet数量超过限制而发生错误
  21. style.styleSheet.cssText = cssText;
  22. }catch(e){
  23.  
  24. }
  25. }
  26. //如果当前styleSheet还不能用,则放到异步中则行
  27. if(style.styleSheet.disabled){
  28. setTimeout(func,10);
  29. }else{
  30. func();
  31. }
  32. }else{ //w3c
  33. //w3c浏览器中只要创建文本节点插入到style元素中就行了
  34. var textNode = document.createTextNode(cssText);
  35. style.appendChild(textNode);
  36. }
  37. head.appendChild(style); //把创建的style元素插入到head中
  38. }
  39.  
  40. //使用
  41. addCSS('*{ text-transform:uppercase;}');
  42.  
  43.  
  44.  
  45.  
  46. // Your code here...
  47. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址