Greasy Fork

Greasy Fork is available in English.

所有小写字母全部变大写

try to take over the world!

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         所有小写字母全部变大写
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       none
// @include        http*
// @include        ftp
// @grant        none
// ==/UserScript==

(function() {

     function addCSS(cssText){
         var style = document.createElement('style'), //创建一个style元素
             head = document.head || document.getElementsByTagName('head')[0]; //获取head元素
         style.type = 'text/css'; //这里必须显示设置style元素的type属性为text/css,否则在ie中不起作用
         if(style.styleSheet){ //IE
             var func = function(){
                 try{ //防止IE中stylesheet数量超过限制而发生错误
                     style.styleSheet.cssText = cssText;
                 }catch(e){

                 }
             }
             //如果当前styleSheet还不能用,则放到异步中则行
             if(style.styleSheet.disabled){
                 setTimeout(func,10);
             }else{
                 func();
             }
         }else{ //w3c
             //w3c浏览器中只要创建文本节点插入到style元素中就行了
             var textNode = document.createTextNode(cssText);
             style.appendChild(textNode);
         }
         head.appendChild(style); //把创建的style元素插入到head中
     }

    //使用
    addCSS('*{ text-transform:uppercase;}');




    // Your code here...
})();