File tree Expand file tree Collapse file tree 5 files changed +15
-7
lines changed Expand file tree Collapse file tree 5 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,14 @@ import { generateAnswersWithChatgptWebApi } from '../services/apis/chatgpt-web.m
32
32
import WebJumpBackNotification from '../components/WebJumpBackNotification'
33
33
34
34
/**
35
+ * @param {string } siteName
35
36
* @param {SiteConfig } siteConfig
36
37
*/
37
- async function mountComponent ( siteConfig ) {
38
+ async function mountComponent ( siteName , siteConfig ) {
39
+ if ( siteName === 'github' && location . href . includes ( '/wiki' ) ) {
40
+ return
41
+ }
42
+
38
43
const userConfig = await getUserConfig ( )
39
44
40
45
if ( ! userConfig . alwaysFloatingSidebar ) {
@@ -110,6 +115,9 @@ async function mountComponent(siteConfig) {
110
115
111
116
const container = document . createElement ( 'div' )
112
117
container . id = 'chatgptbox-container'
118
+ if ( siteName === 'google' || siteName === 'kagi' ) {
119
+ container . style . width = '350px'
120
+ }
113
121
render (
114
122
< DecisionCard
115
123
session = { initSession ( {
@@ -337,7 +345,7 @@ async function prepareForStaticCard() {
337
345
}
338
346
}
339
347
340
- if ( initSuccess ) mountComponent ( siteConfig [ siteName ] )
348
+ if ( initSuccess ) mountComponent ( siteName , siteConfig [ siteName ] )
341
349
}
342
350
}
343
351
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
14
14
) {
15
15
const searchValue = await getInput ( config . baidu . inputQuery )
16
16
if ( searchValue ) {
17
- mountComponent ( config . baidu )
17
+ mountComponent ( 'baidu' , config . baidu )
18
18
}
19
19
}
20
20
} )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
14
14
const newPath = getVideoPath ( )
15
15
if ( newPath !== oldPath ) {
16
16
oldPath = newPath
17
- mountComponent ( config . bilibili )
17
+ mountComponent ( 'bilibili' , config . bilibili )
18
18
}
19
19
}
20
20
window . setInterval ( checkPathChange , 500 )
Original file line number Diff line number Diff line change @@ -130,13 +130,13 @@ export default {
130
130
if ( location . href !== oldUrl ) {
131
131
oldUrl = location . href
132
132
if ( isPull ( ) || isIssue ( ) ) {
133
- mountComponent ( config . github )
133
+ mountComponent ( 'github' , config . github )
134
134
return
135
135
}
136
136
137
137
const patchUrl = await getPatchUrl ( )
138
138
if ( patchUrl ) {
139
- mountComponent ( config . github )
139
+ mountComponent ( 'github' , config . github )
140
140
}
141
141
}
142
142
}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
14
14
const checkUrlChange = async ( ) => {
15
15
if ( location . href !== oldUrl ) {
16
16
oldUrl = location . href
17
- mountComponent ( config . youtube )
17
+ mountComponent ( 'youtube' , config . youtube )
18
18
}
19
19
}
20
20
window . setInterval ( checkUrlChange , 500 )
You can’t perform that action at this time.
0 commit comments