레이블이 js인 게시물을 표시합니다. 모든 게시물 표시
레이블이 js인 게시물을 표시합니다. 모든 게시물 표시

2016년 7월 22일 금요일

How to check Developer tool window open




http://stackoverflow.com/questions/7798748/find-out-whether-chrome-console-is-open

In my case,



function isInspectOpen()
{
console.profile();
console.profileEnd();
if (console.clear) console.clear();
return console.profiles.length > 0;
}
view raw check1.js hosted with ❤ by GitHub
window.onresize = function()
{
if ((window.outerHeight - window.innerHeight) > 100)
alert('Docked inspector was opened');
}
view raw check2.js hosted with ❤ by GitHub
var checkStatus;
var element = new Image();
// var element = document.createElement('any');
element.__defineGetter__('id', function() {
checkStatus = 'on';
});
setInterval(function() {
checkStatus = 'off';
console.log(element);
console.clear();
document.querySelector('#devtool-status').innerHTML = checkStatus;
}, 1000)
view raw check3.js hosted with ❤ by GitHub
var element = new Image();
Object.defineProperty(element, 'id', {
get: function () {
/* TODO */
alert('囧');
}
});
console.log('%cHello', element);
view raw check4.js hosted with ❤ by GitHub

I use check4.js

check1.js, check2.js code can't check developer tools open event.
check3.js code check using setInterval() function.

check4.js
code use Object definedProperty() function on get() function.
console.log("%c hello", element)

When console.log called, element object call get() function.
And you can check developer tools open

Happy Coding!

2016년 2월 1일 월요일

jsPerf

http://jsperf.com/

This site test javascript performances.

About test example
 triple-equals-vs-double-equals

Page like this.



If you click 'Run tests'

processing and return result to you.
like this.

Testing in Chrome 48.0.2564.97 32-bit on Windows NT 6.3 64-bit
TestOps/sec
===
if (s1 === s2) {}
if (s1 === s3) {}
if (s1 === s4) {}
if (s1 === s5) {}
126,211,632±1.51%89% slower
==
if (s1 == s2) {}
if (s1 == s3) {}
if (s1 == s4) {}
if (s1 == s5) {}
10,709,041±5.01%99% slower
!==
if (s1 !== s2) {}
if (s1 !== s3) {}
if (s1 !== s4) {}
if (s1 !== s5) {}
70,270,530±0.00%fastest
!=
if (s1 != s2) {}
if (s1 != s3) {}
if (s1 != s4) {}
if (s1 != s5) {}
5,273,440±0.00%fastest
=== on same type only
if (s1 === s3) {}
if (s1 === s5) {}
if (s1 === s3) {}
if (s1 === s5) {}
739,712,962±0.00%fastest
== on same type only
if (s1 == s3) {}
if (s1 == s5) {}
if (s1 == s3) {}
if (s1 == s5) {}
565,679,421±0.00%fastest
!== on same type only
if (s1 !== s3) {}
if (s1 !== s5) {}
if (s1 !== s3) {}
if (s1 !== s5) {}
706,719,526±0.00%fastest
!= on same type only
if (s1 != s3) {}
if (s1 != s5) {}
if (s1 != s3) {}
if (s1 != s5) {}
1,133,703,804±0.00%fastest

JIRA Plugin - ScriptRunner 소개 #2

관련 글 소개 #1:  https://pineoc.blogspot.com/2019/03/scriptrunner-1.html ScriptRunner 소개 #2 지난 글에서는 Behaviours를 보았고 다음 내용인 콘솔, 리스너 등을 ...