Skip to content

Commit

Permalink
fix a bug: I am considering replacing the 'class' attribute of the ch…
Browse files Browse the repository at this point in the history
…atGptBox with the 'id' attribute because some unknown scripts in the Bing International search web page are automatically blocking elements with the 'class' attribute when they are prepended. However, elements with the 'id' attribute are not blocked. Therefore, the chatGptBox may disappear from the search page
  • Loading branch information
liujuntao123 authored and josStorer committed Apr 26, 2023
1 parent 70fd775 commit c1d805f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/content-script/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function mountComponent(siteConfig, userConfig) {
else await new Promise((r) => setTimeout(r, 500))
}
}
document.querySelectorAll('.chatgptbox-container').forEach((e) => {
document.querySelectorAll('.chatgptbox-container,#chatgptbox-container').forEach((e) => {
unmountComponentAtNode(e)
e.remove()
})
Expand All @@ -57,12 +57,12 @@ async function mountComponent(siteConfig, userConfig) {
if (userConfig.inputQuery) question = await getInput([userConfig.inputQuery])
if (!question && siteConfig) question = await getInput(siteConfig.inputQuery)

document.querySelectorAll('.chatgptbox-container').forEach((e) => {
document.querySelectorAll('.chatgptbox-container,#chatgptbox-container').forEach((e) => {
unmountComponentAtNode(e)
e.remove()
})
const container = document.createElement('div')
container.className = 'chatgptbox-container'
container.id='chatgptbox-container'
render(
<DecisionCard
session={initSession()}
Expand Down
4 changes: 2 additions & 2 deletions src/content-script/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
margin-left: 60px;
}

.chatgptbox-container * {
.chatgptbox-container,#chatgptbox-container * {
font-family: 'Cairo', sans-serif;
font-size: 14px;
}

.chatgptbox-container {
.chatgptbox-container,#chatgptbox-container {
width: 100%;
flex-basis: 0;
flex-grow: 1;
Expand Down

0 comments on commit c1d805f

Please sign in to comment.