We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77e8bc8 commit 6886985Copy full SHA for 6886985
devtools-snippets/logGlobals.js
@@ -0,0 +1,33 @@
1
+/*
2
+ log-globals
3
+ by Sindre Sorhus
4
+ https://github.com/sindresorhus/log-globals
5
+ MIT License
6
+*/
7
+(function () {
8
+ 'use strict';
9
+
10
+ function getIframe() {
11
+ var el = document.createElement('iframe');
12
+ el.style.display = 'none';
13
+ document.body.appendChild(el);
14
+ var win = el.contentWindow;
15
+ document.body.removeChild(el);
16
+ return win;
17
+ }
18
19
+ function detectGlobals() {
20
+ var iframe = getIframe();
21
+ var ret = Object.create(null);
22
23
+ for (var prop in window) {
24
+ if (!(prop in iframe)) {
25
+ ret[prop] = window[prop];
26
27
28
29
+ return Object.keys(ret);
30
31
32
+ console.log(detectGlobals());
33
+})();
0 commit comments