Skip to content

feat: improve browser plugin indicator UI#343

Open
chazz1 wants to merge 1 commit into
lsdefine:mainfrom
chazz1:feat/improve-browser-plugin-ui
Open

feat: improve browser plugin indicator UI#343
chazz1 wants to merge 1 commit into
lsdefine:mainfrom
chazz1:feat/improve-browser-plugin-ui

Conversation

@chazz1
Copy link
Copy Markdown

@chazz1 chazz1 commented May 12, 2026

Changes

  • Draggable badge: Indicator badge can now be dragged freely, position saved to localStorage
  • Collapsible info panel: Click badge shows/hides info panel with URL and Title (instead of alert dialog)
  • Panel positioning: Info panel appears centered above the badge
  • GA_ prefix: Badge text now shows "GA_ljq_driver: 已连接"

- Make indicator badge draggable with position persistence (localStorage)
- Replace alert dialog with collapsible info panel
- Center panel above the badge
- Add GA_ prefix to badge text
Copy link
Copy Markdown
Owner

@lsdefine lsdefine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

几个问题需要修:

  1. XSS: L69-71 innerHTML 直接拼接 location.hrefdocument.title,恶意页面可通过 title 注入。改用 textContent 赋值。

  2. 重复 appendChild: L64 和 L72 对同一个 panel 做了两次 appendChild,删掉 L72。

  3. JSON.parse(saved) (L15) 加 try-catch,localStorage 被改坏时不要让整个 script 挂掉。

另外,作为一个边缘状态指示器,代码应尽量精简。当前 info panel 的定位逻辑和样式比较冗长,考虑精简——indicator 本身不是核心功能,够用就行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants