Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nig-798 #141

Merged
merged 1 commit into from
May 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/content/addToTwitterHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export const addPriceComponent = (element: Element, tweetId: string, twitterUser

export const addVoteComponent = (element: Element, tweetId: string, userName: string) => {
const voteContainer = document.createElement('div');
const repostContainer = element.querySelector<HTMLDivElement>(
zhbyak marked this conversation as resolved.
Show resolved Hide resolved
'article > div >div > div:nth-child(1)'
);
// 如果是转发的话,目前 innerText 会是 You reposted,判断如果有内容不管是什么文案我们就认为是转发的
const isRepost = repostContainer && repostContainer.innerText !== '';
// 如果是转发不要附加 vote 组件
if (isRepost) return;
const specificElement = element.querySelector(
zhbyak marked this conversation as resolved.
Show resolved Hide resolved
'article > div > div > div:nth-child(2) > div:nth-child(2) > div:nth-child(4) > div > div'
);
Expand Down
Loading