Skip to content

Commit

Permalink
Merge pull request #7 from Natsukage/main
Browse files Browse the repository at this point in the history
修复样式问题,以及与Lite_Tools的隐藏图标功能兼容性
  • Loading branch information
pk5ls20 committed Jun 7, 2024
2 parents 5c3ee95 + be389c3 commit 52c03d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/app/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/renderer/injectChatFuncBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export const injectChatFuncBarObserver = new MutationObserver((mutations) => {
const lastElementChild = funcBar.lastElementChild;
if (lastElementChild) {
const openButton = lastElementChild.cloneNode(true) as Element;

// 查找并修改特定的嵌套 <div> 元素
const iconItem = openButton.querySelector('div.icon-item');
if (iconItem) {
iconItem.id = 'id-func-bar-neko-image';
iconItem.setAttribute('aria-label', 'NekoImage');
}
const icon = openButton.getElementsByTagName('i')[0];
icon.innerHTML = iconHtml;
openButton.addEventListener('click', () => {
Expand Down

0 comments on commit 52c03d8

Please sign in to comment.