Last active
February 6, 2018 07:19
-
-
Save joonahn/459dd64f63e61fffbcf6e618e2f4df39 to your computer and use it in GitHub Desktop.
IBKbizware 가 windows 64bit firefox에서 동작하지 않는 문제를 브라우저 수준에서 해결
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name bizware login script | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http://www.ibkbizware.co.kr/* | |
// @grant none | |
// ==/UserScript== eElement.insertBefore(newFirstElement, eElement.firstChild); | |
window.getBrowserInfo = (function getBrowserInfo(gb){ | |
var appName = navigator.appName; | |
var userAgent = navigator.userAgent; | |
var platform = navigator.platform; | |
var OS; | |
var BrowserName; | |
var BrowserVersion; | |
var rtnVal; | |
// OS정보 | |
// 64bit 시스템에서는 platform 변수가 win64임 | |
if(platform.toLowerCase().indexOf('win') != -1){ | |
OS = 'window'; | |
} | |
if(OS == 'window'){ | |
OS = 'win9x'; | |
if(userAgent.indexOf('Windows 98') != -1 || userAgent.indexOf('Win98') != -1){ | |
OS = 'window98'; | |
} | |
if(userAgent.indexOf('Windows ME') != -1){ | |
OS = 'winME'; | |
} | |
if(userAgent.indexOf('Windows NT 5.0') != -1){ | |
OS = 'win2000'; | |
} | |
if(userAgent.indexOf('Windows NT 5.1') != -1){ | |
OS = 'winXP'; | |
} | |
if(userAgent.indexOf('Windows NT 6.0') != -1){ | |
OS = 'winVista'; | |
} | |
if(userAgent.indexOf('Windows NT 6.1') != -1){ | |
OS = 'win7'; | |
} | |
} | |
if(userAgent.indexOf('Mac') != -1){ | |
OS = 'Mac'; | |
} | |
if(userAgent.indexOf('Linux') != -1 || userAgent.indexOf('x86_64') != -1 || userAgent.indexOf('ia_64 ME') != -1 || userAgent.indexOf('ppc_64') != -1){ | |
OS = 'linux64'; | |
} | |
if((userAgent.indexOf('Linux') != -1) && ((userAgent.toLowerCase().indexOf('i386') != -1) || (userAgent.toLowerCase().indexOf('i686') != -1))){ | |
OS = 'linux32'; | |
} | |
// 브라우저정보 | |
if(appName == 'Microsoft Internet Explorer'){ | |
BrowserName = 'IE'; | |
BrowserVersion = userAgent.substring(userAgent.indexOf('MSIE')); | |
BrowserVersion = BrowserVersion.substring(BrowserVersion.indexOf(' ')+1, BrowserVersion.indexOf(';')); | |
} | |
// Firefox만 OS 정보 확인함 | |
if(userAgent.indexOf('Firefox') != -1){ | |
BrowserName = 'Firefox'; | |
BrowserVersion = userAgent.substring(userAgent.indexOf('Firefox')); | |
if(OS.indexOf('win') > -1){ | |
BrowserVersion = BrowserVersion.substring(BrowserVersion.indexOf('/')+1, BrowserVersion.indexOf(' ')); | |
}else{ | |
BrowserVersion = BrowserVersion.substring(BrowserVersion.indexOf('/')+1); | |
} | |
} | |
if(userAgent.indexOf('Opera') != -1){ | |
BrowserName = 'Opera'; | |
BrowserVersion = userAgent.substring(userAgent.indexOf('Version')); | |
BrowserVersion = BrowserVersion.substring(BrowserVersion.indexOf('/')+1); | |
} | |
if(userAgent.indexOf('Chrome') != -1){ | |
BrowserName = 'Chrome'; | |
BrowserVersion = userAgent.substring(userAgent.indexOf('Chrome')); | |
BrowserVersion = BrowserVersion.substring(BrowserVersion.indexOf('/')+1, BrowserVersion.indexOf(' ')); | |
} | |
if(userAgent.indexOf('Safari') != -1 && userAgent.indexOf('Chrome') == -1){ | |
BrowserName = 'Safari'; | |
BrowserVersion = userAgent.substring(userAgent.indexOf('Version')); | |
BrowserVersion = BrowserVersion.substring(BrowserVersion.indexOf('/')+1, BrowserVersion.indexOf(' ')); | |
} | |
if(gb == "OS"){ | |
rtnVal = OS; | |
}else if(gb == "BR"){ | |
rtnVal = BrowserName; | |
}else if(gb == "BR_VER"){ | |
rtnVal = BrowserVersion; | |
} | |
return rtnVal; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment