사용자 도구

사이트 도구


userscripts

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
마지막 판 양쪽 다음 판
userscripts [2020/08/17 16:04]
kwon37xi
userscripts [2020/09/06 23:01]
kwon37xi
줄 15: 줄 15:
 </code> </code>
  
-df;ksjda+===== DOM loaded ===== 
 +  * DOM 조작시 DOM 이 로딩이 덜 된 상태에서 수행하면 소용이 없다. 따라서 다음 템플릿에 따라 작성하면 DOM 로딩이 끝난 뒤에 작동하게 된다. 
 + 
 +<code javascript> 
 +(function() { 
 +    'use strict'; 
 + 
 +    var newMappings = { 
 +        "`": "~", 
 +        "1": "!", 
 +        "2": "@", 
 +        "3": "#", 
 +        "4": "$", 
 +        "5": "%", 
 +        "6": "^", 
 +        "7": "&", 
 +        "8": "*", 
 +        "9": "(", 
 +        "0": ")", 
 +        "-": "_", 
 +        "=": "+" /*, 
 +        "b": "n", 
 +        "i": "?" - no need in vivaldi */ 
 +    }; 
 + 
 +    // execute after all DOM loaded 
 +    window.addEventListener('load', function() { 
 +        var buttons = document.getElementsByClassName("toolbutton"); 
 +        console.log("buttons : " + buttons.length); 
 +        var i; 
 + 
 +        for (i = 0; i < buttons.length; i++) { 
 +            if (buttons[i].accessKey) { 
 +                var accessKey = buttons[i].accessKey.toLowerCase(); 
 +                console.log("idx " + i + "  " + buttons[i].accessKey); 
 +                if (newMappings[accessKey]) { 
 +                    buttons[i].accessKey = newMappings[accessKey]; 
 +                } 
 +            } 
 +        } 
 +    }, false); 
 +})(); 
 +</code> 
userscripts.txt · 마지막으로 수정됨: 2020/09/06 23:01 저자 kwon37xi