-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevtools.js
23 lines (23 loc) · 932 Bytes
/
devtools.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// devtools-detect runs a setInterval which is gross
// Copied the non setInterval parts from
// https://raw.githubusercontent.com/sindresorhus/devtools-detect/master/index.js
// Licenced MIT is the same as the rest of this project
var devtools = {
threshold: 160,
get open() {
with (this) {
widthThreshold = (window.outerWidth - window.innerWidth) > threshold;
heightThreshold = (window.outerHeight - window.innerHeight) > threshold;
orientation = widthThreshold ? 'vertical' : 'horizontal'
_open = (
!(heightThreshold && widthThreshold) &&
(
(window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized)
|| widthThreshold || heightThreshold
)
);
orientation = _open ? orientation : 'undefined';
return _open;
}
}
};