Skip to content

Instantly share code, notes, and snippets.

@sublee
Last active October 10, 2015 18:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sublee/3736189 to your computer and use it in GitHub Desktop.
Save sublee/3736189 to your computer and use it in GitHub Desktop.
WebOffice Login for Google Chrome

WebOffice Login for Google Chrome

소개

Google Chrome으로 WebOffice에서 출근체크할 수 있도록 해주는 사용자 스크립트입니다. 아주 빠른 Google Chrome으로 남들보다 빨리 출근해보세요.

만든이: 루팡팀 이흥섭

사용법

  1. weboffice-chrome.user.js을 다운로드합니다.
  2. Google Chrome 주소창 오른쪽에 있는 렌치 아이콘을 누릅니다.
  3. 도구(L) » 확장 프로그램(E) 메뉴를 선택합니다. 또는 주소창에 chrome://chrome/extensions/를 입력해도 됩니다.
  4. 다운로드한 weboffice-chrome.user.js를 확장 프로그램 관리도구에 끌어다 놓습니다.
// ==UserScript==
// @name WebOffice Login for Google Chrome
// @version 0.0.2
// @namespace https://gist.github.com/3736189
// @description Makes WebOffice to be worked on Google Chrome.
// @match http://hr.weboffice.co.kr/main/jsp/login.jsp
// @match http://hr.weboffice.co.kr/tam/tm_attend/tm_attend*
// @copyright 2012, Heungsub Lee <sub@nexon.co.kr>
// @license Public Domain
// ==/UserScript==
var fn = function() {
// patch XSheet parser
var _makeXSheetWithXmlText = window.makeXSheetWithXmlText;
window.makeXSheetWithXmlText = function(xmlText, mode) {
var try_these = Try.these;
Try.these = function() {
var xdom = {};
xdom.loadXML = function(xml) {
this.__proto__ = (new DOMParser()).parseFromString(xml, 'text/xml');
window.xdom = this;
if (this.documentElement.nodeName == 'parsererror') {
this.parseError = {errorCode: 1};
} else {
this.parseError = {errorCode: 0};
}
};
return xdom;
};
var result = _makeXSheetWithXmlText(xmlText, mode);
Try.these = try_these;
return result;
};
// methods for XmlSheet, XMLDocument
XmlSheet.prototype.EtcData = function(key) {
var etcs = this.xdom.documentElement.getElementsByTagName('ETC');
var result = null;
$A(etcs).each(function(e) {
if (e.getAttribute('KEY') == key) {
result = e.childNodes[0].data;
return false;
}
});
return result;
};
XMLDocument.prototype.selectNodes = function(xpath) {
var result = document.evaluate(xpath, this.documentElement, null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE);
var nodes = [];
for (var i = 0; i < result.snapshotLength; ++i) {
nodes.push(result.snapshotItem(i));
}
return nodes;
};
XMLDocument.prototype.selectSingleNode = function(xpath) {
var nodes = this.selectNodes(xpath);
if (nodes.length) {
return nodes[0];
}
return null;
};
// run InitPage again
document.forms[0].document = document.forms[0];
InitPage();
};
var e = document.createElement('script');
e.innerHTML = '(' + fn.toString() + ')();';
var scripts = document.head.getElementsByTagName('script');
var target = scripts[scripts.length - 1];
target.parentNode.insertBefore(e, target);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment