openfox 1.6.75 → 1.6.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/dist/agent-defaults/code-reviewer.agent.md +1 -0
- package/dist/agent-defaults/explorer.agent.md +2 -1
- package/dist/agent-defaults/verifier.agent.md +4 -0
- package/dist/{ask-3RK5YJZE.js → ask-5SSOA6SZ.js} +2 -2
- package/dist/{auth-LZZX63KI.js → auth-56SIRACI.js} +3 -6
- package/dist/auto-compaction-GOHNI2R2.js +27 -0
- package/dist/{branch.api-XADFZZAA.js → branch.api-PWFW26KC.js} +2 -2
- package/dist/{chat-handler-KYMMXPP6.js → chat-handler-K2RDXBO6.js} +31 -29
- package/dist/{chunk-IA4O65CR.js → chunk-6SYNGMU4.js} +100 -68
- package/dist/{chunk-AFATQ5LJ.js → chunk-B5AP3RSV.js} +1 -1
- package/dist/{chunk-PFRQO5Z3.js → chunk-BBC46FN4.js} +61 -28
- package/dist/{chunk-22CTURMH.js → chunk-BJYPTN5S.js} +1 -1
- package/dist/{chunk-DLINTLB7.js → chunk-BSTVRSV6.js} +7 -5
- package/dist/{chunk-7JPKRM6M.js → chunk-CMQCO27Y.js} +22 -12
- package/dist/{chunk-R4HADRYO.js → chunk-CQGTEGKL.js} +1 -1
- package/dist/{chunk-J5DV33SS.js → chunk-CUDAT6SS.js} +46 -18
- package/dist/{chunk-ETIXH35K.js → chunk-EBQYRNNU.js} +535 -291
- package/dist/{chunk-4CQ7CUQ6.js → chunk-I7JVS7V5.js} +5 -5
- package/dist/{chunk-PNBH3RAX.js → chunk-K44MW7JJ.js} +1 -1
- package/dist/{chunk-BLNFJ22S.js → chunk-KIOUKC3Z.js} +6 -4
- package/dist/{chunk-CTAIXOZJ.js → chunk-NDJ6FKSP.js} +1 -1
- package/dist/{chunk-VIGOXEZG.js → chunk-OJBFC6ER.js} +15 -16
- package/dist/{chunk-GQZGIMJO.js → chunk-OXI26S7U.js} +12 -7
- package/dist/{chunk-NBU6KIOD.js → chunk-PBGOZMVY.js} +4 -4
- package/dist/{chunk-B7E3BICY.js → chunk-RGRBWDZP.js} +2 -4
- package/dist/{chunk-KFBIHS3S.js → chunk-STYHKCG7.js} +20 -14
- package/dist/{chunk-55Z3DJ7G.js → chunk-TGWEH2BC.js} +10 -11
- package/dist/{chunk-TYUNDOX2.js → chunk-UKMRZDWM.js} +90 -41
- package/dist/{chunk-5UTTLO4D.js → chunk-UVN6AKIO.js} +89 -49
- package/dist/{chunk-574HZVLE.js → chunk-VRGRAQDG.js} +2 -2
- package/dist/{chunk-JQBTYHUR.js → chunk-WR6QCJJO.js} +53 -15
- package/dist/{chunk-RBPOAAIZ.js → chunk-XKIEDGQF.js} +22 -18
- package/dist/{chunk-XIZ6B6IS.js → chunk-XSUQDB6R.js} +541 -299
- package/dist/cli/dev.js +2 -2
- package/dist/cli/index.js +2 -2
- package/dist/{config-6T4EHAP2.js → config-5CONAOL7.js} +7 -7
- package/dist/{events-LKEZ3YCW.js → events-5RIXWI5Y.js} +6 -6
- package/dist/{folding-JN2WT44N.js → folding-JNOUTI5Z.js} +2 -2
- package/dist/{inspect-proxy-Y4MRAVB7.js → inspect-proxy-Y75AXMRX.js} +3 -3
- package/dist/{manager-HM2J5VMW.js → manager-W7N3XQ4Q.js} +3 -3
- package/dist/orchestrator-TW5II347.js +43 -0
- package/dist/package.json +19 -3
- package/dist/{paths-ZRI56O63.js → paths-X46PPOI2.js} +2 -2
- package/dist/{processor-23O4HPSS.js → processor-MZ3QIUED.js} +15 -11
- package/dist/{project-creator-LASKNQPA.js → project-creator-VD7MLOWE.js} +8 -5
- package/dist/{projects-HEUOWNSR.js → projects-XLMSDFTQ.js} +4 -4
- package/dist/{protocol-5AWNGFLH.js → protocol-4CTV7OZC.js} +3 -3
- package/dist/{protocol-DRBnujwe.d.ts → protocol-4xbfAlGO.d.ts} +3 -0
- package/dist/{provider-AKN355YH.js → provider-ESEBV3LL.js} +15 -11
- package/dist/{pwa-GHQCMCIU.js → pwa-76XP2DY2.js} +2 -2
- package/dist/{runtime-config-ZCK74XKM.js → runtime-config-CBJJJGBD.js} +2 -2
- package/dist/{serve-TW63YCNQ.js → serve-FTTLGRAO.js} +29 -27
- package/dist/server/index.d.ts +6 -1
- package/dist/server/index.js +22 -22
- package/dist/server/public/__inspect__.js +163 -143
- package/dist/{service-74Z7JK2J.js → service-D6LC3CAM.js} +3 -2
- package/dist/{settings-NI4ITGV6.js → settings-TQNQB56H.js} +4 -4
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/{store-2IF3ZSLD.js → store-OQ45KONN.js} +2 -2
- package/dist/{tools-RUAY6EVI.js → tools-QJ5K5IJP.js} +18 -18
- package/dist/{vision-fallback-AXH3BGJC.js → vision-fallback-ED27LH6C.js} +3 -3
- package/dist/web/__inspect__.js +178 -155
- package/dist/web/assets/{index-CWdKiSP8.js → index-FjLp1t6r.js} +62 -62
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +19 -3
- package/dist/auto-compaction-OW4P2QWQ.js +0 -27
- package/dist/orchestrator-QP4O7MUM.js +0 -43
package/dist/web/__inspect__.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
'use strict'
|
|
1
|
+
;(function () {
|
|
2
|
+
'use strict'
|
|
3
3
|
|
|
4
|
-
window.__foxInspectMode = false
|
|
5
|
-
window.__foxSessionId = null
|
|
6
|
-
window.__foxSessionTitle = null
|
|
7
|
-
window.__foxInspectEnabled = true
|
|
8
|
-
window.__foxSentPending = false
|
|
9
|
-
window.__foxPopupOpen = false
|
|
10
|
-
window.__foxHighlightedEl = null
|
|
4
|
+
window.__foxInspectMode = false
|
|
5
|
+
window.__foxSessionId = null
|
|
6
|
+
window.__foxSessionTitle = null
|
|
7
|
+
window.__foxInspectEnabled = true
|
|
8
|
+
window.__foxSentPending = false
|
|
9
|
+
window.__foxPopupOpen = false
|
|
10
|
+
window.__foxHighlightedEl = null
|
|
11
11
|
|
|
12
|
-
var overlayStyle = document.createElement('style')
|
|
12
|
+
var overlayStyle = document.createElement('style')
|
|
13
13
|
overlayStyle.textContent = [
|
|
14
14
|
'#__fox-overlay{position:fixed;bottom:16px;right:16px;z-index:2147483647;font-family:system-ui,sans-serif;font-size:13px;pointer-events:none}',
|
|
15
15
|
'#__fox-widget{background:#1e1e1e;color:#e0e0e0;padding:8px 12px;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.4);display:flex;align-items:center;gap:10px;pointer-events:auto}',
|
|
@@ -30,75 +30,76 @@
|
|
|
30
30
|
'#__fox-popup button.__fox-send:hover{background:#2563eb}',
|
|
31
31
|
'#__fox-popup button.__fox-cancel{background:transparent;color:#888;border:1px solid #444;padding:6px 14px;border-radius:4px;cursor:pointer;font-size:12px;font-family:inherit}',
|
|
32
32
|
'#__fox-popup button.__fox-cancel:hover{color:#aaa;border-color:#666}',
|
|
33
|
-
'#__fox-popup .__fox-hint{font-size:11px;color:#666;margin-top:6px;line-height:1.4}'
|
|
34
|
-
].join('\n')
|
|
33
|
+
'#__fox-popup .__fox-hint{font-size:11px;color:#666;margin-top:6px;line-height:1.4}',
|
|
34
|
+
].join('\n')
|
|
35
35
|
|
|
36
|
-
var overlay = document.createElement('div')
|
|
37
|
-
overlay.id = '__fox-overlay'
|
|
38
|
-
overlay.innerHTML =
|
|
36
|
+
var overlay = document.createElement('div')
|
|
37
|
+
overlay.id = '__fox-overlay'
|
|
38
|
+
overlay.innerHTML =
|
|
39
|
+
'<div id="__fox-widget">' +
|
|
39
40
|
'<span class="__fox-label">OpenFox</span>' +
|
|
40
41
|
'<button id="__fox-toggle">Send feedback</button>' +
|
|
41
|
-
'</div>'
|
|
42
|
+
'</div>'
|
|
42
43
|
|
|
43
|
-
var toggleBtn
|
|
44
|
+
var toggleBtn
|
|
44
45
|
|
|
45
46
|
function setInspectMode(enabled) {
|
|
46
|
-
window.__foxInspectMode = enabled
|
|
47
|
+
window.__foxInspectMode = enabled
|
|
47
48
|
if (toggleBtn) {
|
|
48
|
-
toggleBtn.textContent = enabled ? 'Exit inspect' : 'Send feedback'
|
|
49
|
-
toggleBtn.classList.toggle('__fox-active', enabled)
|
|
49
|
+
toggleBtn.textContent = enabled ? 'Exit inspect' : 'Send feedback'
|
|
50
|
+
toggleBtn.classList.toggle('__fox-active', enabled)
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
function clearHighlights() {
|
|
54
55
|
if (window.__foxHighlightedEl) {
|
|
55
|
-
window.__foxHighlightedEl.classList.remove('__fox-highlight')
|
|
56
|
-
window.__foxHighlightedEl = null
|
|
56
|
+
window.__foxHighlightedEl.classList.remove('__fox-highlight')
|
|
57
|
+
window.__foxHighlightedEl = null
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
function generateXPath(el) {
|
|
61
|
-
if (!el || el.nodeType !== Node.ELEMENT_NODE) return ''
|
|
62
|
-
var parts = []
|
|
62
|
+
if (!el || el.nodeType !== Node.ELEMENT_NODE) return ''
|
|
63
|
+
var parts = []
|
|
63
64
|
while (el && el.nodeType === Node.ELEMENT_NODE && el !== document.documentElement) {
|
|
64
|
-
var index = 1
|
|
65
|
-
var sibling = el.previousSibling
|
|
65
|
+
var index = 1
|
|
66
|
+
var sibling = el.previousSibling
|
|
66
67
|
while (sibling) {
|
|
67
|
-
if (sibling.nodeType === Node.ELEMENT_NODE && sibling.nodeName === el.nodeName) index
|
|
68
|
-
sibling = sibling.previousSibling
|
|
68
|
+
if (sibling.nodeType === Node.ELEMENT_NODE && sibling.nodeName === el.nodeName) index++
|
|
69
|
+
sibling = sibling.previousSibling
|
|
69
70
|
}
|
|
70
|
-
parts.unshift(el.nodeName.toLowerCase() + '[' + index + ']')
|
|
71
|
-
el = el.parentNode
|
|
71
|
+
parts.unshift(el.nodeName.toLowerCase() + '[' + index + ']')
|
|
72
|
+
el = el.parentNode
|
|
72
73
|
}
|
|
73
|
-
return '/' + parts.join('/')
|
|
74
|
+
return '/' + parts.join('/')
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
function stripSvgAndGetText(el) {
|
|
77
78
|
try {
|
|
78
|
-
var clone = el.cloneNode(true)
|
|
79
|
-
var svgs = clone.querySelectorAll('svg')
|
|
79
|
+
var clone = el.cloneNode(true)
|
|
80
|
+
var svgs = clone.querySelectorAll('svg')
|
|
80
81
|
for (var i = 0; i < svgs.length; i++) {
|
|
81
|
-
svgs[i].remove()
|
|
82
|
+
svgs[i].remove()
|
|
82
83
|
}
|
|
83
|
-
var text = (clone.textContent || '').replace(/\s+/g, ' ').trim()
|
|
84
|
-
return text.slice(0, 500) || null
|
|
84
|
+
var text = (clone.textContent || '').replace(/\s+/g, ' ').trim()
|
|
85
|
+
return text.slice(0, 500) || null
|
|
85
86
|
} catch (e) {
|
|
86
|
-
return null
|
|
87
|
+
return null
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
function buildElementData(el) {
|
|
91
|
-
var attrs = {}
|
|
92
|
+
var attrs = {}
|
|
92
93
|
if (el.attributes) {
|
|
93
94
|
for (var i = 0; i < el.attributes.length; i++) {
|
|
94
|
-
var attr = el.attributes[i]
|
|
95
|
+
var attr = el.attributes[i]
|
|
95
96
|
if (attr.name !== 'class' && attr.name !== 'id') {
|
|
96
|
-
attrs[attr.name] = attr.value
|
|
97
|
+
attrs[attr.name] = attr.value
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
|
-
var rect = el.getBoundingClientRect()
|
|
101
|
-
var tagName = el.tagName ? el.tagName.toLowerCase() : ''
|
|
101
|
+
var rect = el.getBoundingClientRect()
|
|
102
|
+
var tagName = el.tagName ? el.tagName.toLowerCase() : ''
|
|
102
103
|
return {
|
|
103
104
|
tag: tagName,
|
|
104
105
|
id: el.id || null,
|
|
@@ -108,73 +109,81 @@
|
|
|
108
109
|
textContent: stripSvgAndGetText(el),
|
|
109
110
|
outerHTML: (el.outerHTML || '').slice(0, 1000) || '',
|
|
110
111
|
rect: { x: rect.left, y: rect.top, width: rect.width, height: rect.height },
|
|
111
|
-
attributes: attrs
|
|
112
|
-
}
|
|
112
|
+
attributes: attrs,
|
|
113
|
+
}
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
function showPopup(el, x, y) {
|
|
116
|
-
var existing = document.getElementById('__fox-popup')
|
|
117
|
-
if (existing) existing.remove()
|
|
117
|
+
var existing = document.getElementById('__fox-popup')
|
|
118
|
+
if (existing) existing.remove()
|
|
118
119
|
|
|
119
|
-
window.__foxPopupOpen = true
|
|
120
|
-
var data = buildElementData(el)
|
|
121
|
-
var viewportWidth = window.innerWidth
|
|
122
|
-
var viewportHeight = window.innerHeight
|
|
120
|
+
window.__foxPopupOpen = true
|
|
121
|
+
var data = buildElementData(el)
|
|
122
|
+
var viewportWidth = window.innerWidth
|
|
123
|
+
var viewportHeight = window.innerHeight
|
|
123
124
|
|
|
124
|
-
var left = x + 10
|
|
125
|
-
var top = y + 10
|
|
126
|
-
if (left + 340 > viewportWidth) left = x - 350
|
|
127
|
-
if (top + 280 > viewportHeight) top = y - 290
|
|
128
|
-
if (left < 8) left = 8
|
|
129
|
-
if (top < 8) top = 8
|
|
125
|
+
var left = x + 10
|
|
126
|
+
var top = y + 10
|
|
127
|
+
if (left + 340 > viewportWidth) left = x - 350
|
|
128
|
+
if (top + 280 > viewportHeight) top = y - 290
|
|
129
|
+
if (left < 8) left = 8
|
|
130
|
+
if (top < 8) top = 8
|
|
130
131
|
|
|
131
|
-
var popup = document.createElement('div')
|
|
132
|
-
popup.id = '__fox-popup'
|
|
133
|
-
popup.style.left = left + 'px'
|
|
134
|
-
popup.style.top = top + 'px'
|
|
132
|
+
var popup = document.createElement('div')
|
|
133
|
+
popup.id = '__fox-popup'
|
|
134
|
+
popup.style.left = left + 'px'
|
|
135
|
+
popup.style.top = top + 'px'
|
|
135
136
|
|
|
136
|
-
var tagDisplay = data.tag + (data.id ? '#' + data.id :
|
|
137
|
+
var tagDisplay = data.tag + (data.id ? '#' + data.id : data.className ? '.' + data.className.split(' ')[0] : '')
|
|
137
138
|
|
|
138
139
|
popup.innerHTML =
|
|
139
|
-
'<div class="__fox-tag">Element: <span>' +
|
|
140
|
-
|
|
140
|
+
'<div class="__fox-tag">Element: <span>' +
|
|
141
|
+
tagDisplay +
|
|
142
|
+
'</span></div>' +
|
|
143
|
+
'<div class="__fox-selector">' +
|
|
144
|
+
data.xpath +
|
|
145
|
+
'</div>' +
|
|
141
146
|
'<textarea placeholder="What\'s wrong with this element?"></textarea>' +
|
|
142
|
-
'<div class="__fox-hint">Sending to: ' +
|
|
147
|
+
'<div class="__fox-hint">Sending to: ' +
|
|
148
|
+
(window.__foxSessionTitle || window.__foxSessionId || 'none') +
|
|
149
|
+
'. To target a different session, close this, navigate to that session in OpenFox, and reopen the inspect window.</div>' +
|
|
143
150
|
'<div class="__fox-actions">' +
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
'</div>'
|
|
151
|
+
'<button class="__fox-cancel">Cancel</button>' +
|
|
152
|
+
'<button class="__fox-send">Send to Agent</button>' +
|
|
153
|
+
'</div>'
|
|
147
154
|
|
|
148
|
-
document.body.appendChild(popup)
|
|
155
|
+
document.body.appendChild(popup)
|
|
149
156
|
|
|
150
|
-
var textarea = popup.querySelector('textarea')
|
|
151
|
-
textarea.focus()
|
|
157
|
+
var textarea = popup.querySelector('textarea')
|
|
158
|
+
textarea.focus()
|
|
152
159
|
|
|
153
|
-
textarea.addEventListener('keydown', function(ke) {
|
|
160
|
+
textarea.addEventListener('keydown', function (ke) {
|
|
154
161
|
if (ke.key === 'Enter' && !ke.shiftKey) {
|
|
155
|
-
ke.preventDefault()
|
|
156
|
-
popup.querySelector('.__fox-send').click()
|
|
162
|
+
ke.preventDefault()
|
|
163
|
+
popup.querySelector('.__fox-send').click()
|
|
157
164
|
}
|
|
158
|
-
})
|
|
165
|
+
})
|
|
159
166
|
|
|
160
|
-
popup.querySelector('.__fox-cancel').addEventListener('click', function(e) {
|
|
161
|
-
e.preventDefault()
|
|
162
|
-
e.stopPropagation()
|
|
163
|
-
window.__foxPopupOpen = false
|
|
164
|
-
popup.remove()
|
|
165
|
-
})
|
|
167
|
+
popup.querySelector('.__fox-cancel').addEventListener('click', function (e) {
|
|
168
|
+
e.preventDefault()
|
|
169
|
+
e.stopPropagation()
|
|
170
|
+
window.__foxPopupOpen = false
|
|
171
|
+
popup.remove()
|
|
172
|
+
})
|
|
166
173
|
|
|
167
|
-
popup.querySelector('.__fox-send').addEventListener('click', function(e) {
|
|
168
|
-
e.preventDefault()
|
|
169
|
-
e.stopPropagation()
|
|
170
|
-
if (window.__foxSentPending) return
|
|
171
|
-
window.__foxSentPending = true
|
|
172
|
-
setTimeout(function() {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
popup.querySelector('.__fox-send').addEventListener('click', function (e) {
|
|
175
|
+
e.preventDefault()
|
|
176
|
+
e.stopPropagation()
|
|
177
|
+
if (window.__foxSentPending) return
|
|
178
|
+
window.__foxSentPending = true
|
|
179
|
+
setTimeout(function () {
|
|
180
|
+
window.__foxSentPending = false
|
|
181
|
+
}, 3000)
|
|
182
|
+
var annotation = textarea.value.trim()
|
|
183
|
+
window.__foxPopupOpen = false
|
|
184
|
+
popup.remove()
|
|
185
|
+
clearHighlights()
|
|
186
|
+
setInspectMode(false)
|
|
178
187
|
|
|
179
188
|
fetch('/__openfox_feedback', {
|
|
180
189
|
method: 'POST',
|
|
@@ -183,95 +192,109 @@
|
|
|
183
192
|
sessionId: window.__foxSessionId,
|
|
184
193
|
element: data,
|
|
185
194
|
annotation: annotation,
|
|
186
|
-
pageUrl: window.location.href
|
|
187
|
-
})
|
|
188
|
-
}).catch(function(err) {
|
|
189
|
-
console.error('Failed to send feedback:', err)
|
|
190
|
-
})
|
|
191
|
-
})
|
|
195
|
+
pageUrl: window.location.href,
|
|
196
|
+
}),
|
|
197
|
+
}).catch(function (err) {
|
|
198
|
+
console.error('Failed to send feedback:', err)
|
|
199
|
+
})
|
|
200
|
+
})
|
|
192
201
|
|
|
193
|
-
popup.addEventListener('click', function(e) {
|
|
202
|
+
popup.addEventListener('click', function (e) {
|
|
203
|
+
e.stopPropagation()
|
|
204
|
+
})
|
|
194
205
|
|
|
195
206
|
document.addEventListener('keydown', function escHandler(e) {
|
|
196
207
|
if (e.key === 'Escape') {
|
|
197
|
-
window.__foxPopupOpen = false
|
|
198
|
-
popup.remove()
|
|
199
|
-
clearHighlights()
|
|
200
|
-
setInspectMode(false)
|
|
201
|
-
document.removeEventListener('keydown', escHandler)
|
|
208
|
+
window.__foxPopupOpen = false
|
|
209
|
+
popup.remove()
|
|
210
|
+
clearHighlights()
|
|
211
|
+
setInspectMode(false)
|
|
212
|
+
document.removeEventListener('keydown', escHandler)
|
|
202
213
|
}
|
|
203
|
-
})
|
|
214
|
+
})
|
|
204
215
|
}
|
|
205
216
|
|
|
206
|
-
document.addEventListener(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
217
|
+
document.addEventListener(
|
|
218
|
+
'mouseover',
|
|
219
|
+
function (e) {
|
|
220
|
+
if (!window.__foxInspectMode || window.__foxPopupOpen) return
|
|
221
|
+
if (e.target === document.documentElement || e.target === document.body) return
|
|
222
|
+
if (overlay.contains(e.target)) return
|
|
223
|
+
clearHighlights()
|
|
224
|
+
e.target.classList.add('__fox-highlight')
|
|
225
|
+
window.__foxHighlightedEl = e.target
|
|
226
|
+
},
|
|
227
|
+
true,
|
|
228
|
+
)
|
|
214
229
|
|
|
215
|
-
document.addEventListener(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
230
|
+
document.addEventListener(
|
|
231
|
+
'click',
|
|
232
|
+
function (e) {
|
|
233
|
+
if (!window.__foxInspectMode) return
|
|
234
|
+
if (overlay.contains(e.target)) return
|
|
235
|
+
if (document.getElementById('__fox-popup')) return
|
|
219
236
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
237
|
+
e.preventDefault()
|
|
238
|
+
e.stopPropagation()
|
|
239
|
+
var el = window.__foxHighlightedEl
|
|
240
|
+
if (!el) return
|
|
241
|
+
showPopup(el, e.clientX, e.clientY)
|
|
242
|
+
},
|
|
243
|
+
true,
|
|
244
|
+
)
|
|
226
245
|
|
|
227
|
-
document.addEventListener('keydown', function(e) {
|
|
246
|
+
document.addEventListener('keydown', function (e) {
|
|
228
247
|
if (e.key === 'Escape' && window.__foxInspectMode) {
|
|
229
|
-
clearHighlights()
|
|
230
|
-
setInspectMode(false)
|
|
248
|
+
clearHighlights()
|
|
249
|
+
setInspectMode(false)
|
|
231
250
|
}
|
|
232
251
|
if (e.ctrlKey && e.shiftKey && e.key === 'X') {
|
|
233
|
-
e.preventDefault()
|
|
234
|
-
if (window.__foxInspectMode) clearHighlights()
|
|
235
|
-
setInspectMode(!window.__foxInspectMode)
|
|
252
|
+
e.preventDefault()
|
|
253
|
+
if (window.__foxInspectMode) clearHighlights()
|
|
254
|
+
setInspectMode(!window.__foxInspectMode)
|
|
236
255
|
}
|
|
237
|
-
})
|
|
256
|
+
})
|
|
238
257
|
|
|
239
|
-
window.addEventListener('message', function(e) {
|
|
258
|
+
window.addEventListener('message', function (e) {
|
|
240
259
|
if (e.data && e.data.type === 'setFoxSessionId') {
|
|
241
|
-
window.__foxSessionId = e.data.sessionId
|
|
260
|
+
window.__foxSessionId = e.data.sessionId
|
|
242
261
|
}
|
|
243
262
|
if (e.data && e.data.type === 'setFoxSessionTitle') {
|
|
244
|
-
window.__foxSessionTitle = e.data.sessionTitle
|
|
263
|
+
window.__foxSessionTitle = e.data.sessionTitle
|
|
245
264
|
}
|
|
246
265
|
if (e.data && e.data.type === 'setFoxInspectEnabled') {
|
|
247
|
-
window.__foxInspectEnabled = e.data.enabled
|
|
248
|
-
overlay.style.display = e.data.enabled ? '' : 'none'
|
|
266
|
+
window.__foxInspectEnabled = e.data.enabled
|
|
267
|
+
overlay.style.display = e.data.enabled ? '' : 'none'
|
|
249
268
|
}
|
|
250
|
-
})
|
|
269
|
+
})
|
|
251
270
|
|
|
252
271
|
function init() {
|
|
253
|
-
if (window.__foxInspectInit) return
|
|
254
|
-
window.__foxInspectInit = true
|
|
255
|
-
document.head.appendChild(overlayStyle)
|
|
256
|
-
document.body.appendChild(overlay)
|
|
257
|
-
toggleBtn = document.getElementById('__fox-toggle')
|
|
258
|
-
var widget = document.getElementById('__fox-widget')
|
|
259
|
-
widget.addEventListener(
|
|
260
|
-
|
|
261
|
-
e
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
272
|
+
if (window.__foxInspectInit) return
|
|
273
|
+
window.__foxInspectInit = true
|
|
274
|
+
document.head.appendChild(overlayStyle)
|
|
275
|
+
document.body.appendChild(overlay)
|
|
276
|
+
toggleBtn = document.getElementById('__fox-toggle')
|
|
277
|
+
var widget = document.getElementById('__fox-widget')
|
|
278
|
+
widget.addEventListener(
|
|
279
|
+
'mousedown',
|
|
280
|
+
function (e) {
|
|
281
|
+
e.preventDefault()
|
|
282
|
+
e.stopPropagation()
|
|
283
|
+
},
|
|
284
|
+
true,
|
|
285
|
+
)
|
|
286
|
+
toggleBtn.addEventListener('click', function (e) {
|
|
287
|
+
e.preventDefault()
|
|
288
|
+
e.stopPropagation()
|
|
289
|
+
if (window.__foxInspectMode) clearHighlights()
|
|
290
|
+
setInspectMode(!window.__foxInspectMode)
|
|
291
|
+
})
|
|
292
|
+
overlay.style.display = window.__foxInspectEnabled ? '' : 'none'
|
|
270
293
|
}
|
|
271
294
|
|
|
272
295
|
if (document.body) {
|
|
273
|
-
init()
|
|
296
|
+
init()
|
|
274
297
|
} else {
|
|
275
|
-
document.addEventListener('DOMContentLoaded', init)
|
|
298
|
+
document.addEventListener('DOMContentLoaded', init)
|
|
276
299
|
}
|
|
277
|
-
})()
|
|
300
|
+
})()
|