Skip to content

Commit 87e5679

Browse files
committed
fix: add log on script startup for better debugging
#335
1 parent d659b9d commit 87e5679

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ main()
1212

1313
function main() {
1414
onloadSafe(() => {
15+
// eslint-disable-next-line no-console
16+
console.log('[Exporter] Loaded')
17+
1518
const styleEl = document.createElement('style')
1619
styleEl.id = 'sentinel-css'
1720
document.head.append(styleEl)
@@ -20,20 +23,26 @@ function main() {
2023

2124
const injectNavMenu = (nav: HTMLElement) => {
2225
if (injectionMap.has(nav)) return
26+
// eslint-disable-next-line no-console
27+
console.log('[Exporter] Injecting nav', nav)
2328

2429
const container = getMenuContainer()
2530
injectionMap.set(nav, container)
2631

2732
const chatList = nav.querySelector(':scope > div.sticky.bottom-0')
2833
if (chatList) {
2934
chatList.prepend(container)
35+
// eslint-disable-next-line no-console
36+
console.log('[Exporter] Prepended container to chat list', chatList)
3037
}
3138
else {
3239
// fallback to the bottom of the nav
3340
container.style.backgroundColor = '#171717'
3441
container.style.position = 'sticky'
3542
container.style.bottom = '72px'
3643
nav.append(container)
44+
// eslint-disable-next-line no-console
45+
console.log('[Exporter] Fallback to appending container to nav', nav)
3746
}
3847
}
3948

0 commit comments

Comments
 (0)