Skip to content

Instantly share code, notes, and snippets.

@koreapyj
Created September 15, 2023 19:21
Show Gist options
  • Save koreapyj/68fcdee589b33d98ca2abc5442c15283 to your computer and use it in GitHub Desktop.
Save koreapyj/68fcdee589b33d98ca2abc5442c15283 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name SC비즈니스 제로플러그인 뱅킹
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 플러그인 없는 클린뱅킹
// @author You
// @match https://bb.standardchartered.co.kr/**
// @icon https://www.google.com/s2/favicons?sz=64&domain=standardchartered.co.kr
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
const observer = new MutationObserver((mutations) => {
mutations.forEach(({ addedNodes }) => {
addedNodes.forEach((addedNode) => {
if (addedNode.nodeType === 1 && addedNode.matches('script')) {
const uri = (src => {
try {
return new URL(src)
} catch {
return {}
}
})(addedNode.src)
switch(uri.pathname) {
case '/product/wizvera/delfino/delfino.js':
addedNode.addEventListener('load', (e) => {
/* Delfino 강제 설치 우회, 브라우저 인증서로 작동하도록 함 */
if(window.Delfino?.isInstall) {
window.Delfino.isInstall = (_, cb) => cb(true)
}
})
break
case '/product/AOS2/astx2/astx2.min.js':
addedNode.addEventListener('load', (e) => {
/* AhnLab SafeTransaction의 불필요한 로드 시도 차단 및 설치 페이지 팝업 차단 */
if(window.$ASTX2) {
window.$ASTX2.init = (resolve, reject) => {
reject()
};
window.$ASTX2.getLastError = () => 2147483647;
}
})
break
}
}
});
});
});
observer.observe(document.documentElement, { childList: true, subtree: true });
if(window.IS_WIN) {
window.IS_WIN = false
}
document.querySelector('script[src*="global.js"]')?.addEventListener('load', (e) => {
/* "마우스로 입력" 기능은 윈도가 아닐때만 작동 */
if(window.IS_WIN) {
window.IS_WIN = false
}
})
window.addEventListener('keydown', e => {
const nfdoc = document.querySelector('#nfilter_document')
if(!nfdoc || nfdoc.style?.display == 'none') return
const keyelem = nfdoc.querySelector(`[nfiltercode="${e.key}"]`)
if(keyelem) {
keyelem.click()
return
}
switch(e.key) {
case 'Enter': {
nfdoc.querySelector('#nfilter_enter').click()
break
}
case 'Backspace': {
nfdoc.querySelector('#nfilter_backspace').click()
break
} break
case 'Shift': {
nfdoc.querySelector('#nfilter_shift_l').click()
break
}
default: throw e
}
}, {
capture: true,
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment