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
3232import WebJumpBackNotification from '../components/WebJumpBackNotification'
3333
3434/**
35+ * @param {string } siteName
3536 * @param {SiteConfig } siteConfig
3637 */
37- async function mountComponent ( siteConfig ) {
38+ async function mountComponent ( siteName , siteConfig ) {
39+ if ( siteName === 'github' && location . href . includes ( '/wiki' ) ) {
40+ return
41+ }
42+
3843 const userConfig = await getUserConfig ( )
3944
4045 if ( ! userConfig . alwaysFloatingSidebar ) {
@@ -110,6 +115,9 @@ async function mountComponent(siteConfig) {
110115
111116 const container = document . createElement ( 'div' )
112117 container . id = 'chatgptbox-container'
118+ if ( siteName === 'google' || siteName === 'kagi' ) {
119+ container . style . width = '350px'
120+ }
113121 render (
114122 < DecisionCard
115123 session = { initSession ( {
@@ -337,7 +345,7 @@ async function prepareForStaticCard() {
337345 }
338346 }
339347
340- if ( initSuccess ) mountComponent ( siteConfig [ siteName ] )
348+ if ( initSuccess ) mountComponent ( siteName , siteConfig [ siteName ] )
341349 }
342350}
343351
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
1414 ) {
1515 const searchValue = await getInput ( config . baidu . inputQuery )
1616 if ( searchValue ) {
17- mountComponent ( config . baidu )
17+ mountComponent ( 'baidu' , config . baidu )
1818 }
1919 }
2020 } )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
1414 const newPath = getVideoPath ( )
1515 if ( newPath !== oldPath ) {
1616 oldPath = newPath
17- mountComponent ( config . bilibili )
17+ mountComponent ( 'bilibili' , config . bilibili )
1818 }
1919 }
2020 window . setInterval ( checkPathChange , 500 )
Original file line number Diff line number Diff line change @@ -130,13 +130,13 @@ export default {
130130 if ( location . href !== oldUrl ) {
131131 oldUrl = location . href
132132 if ( isPull ( ) || isIssue ( ) ) {
133- mountComponent ( config . github )
133+ mountComponent ( 'github' , config . github )
134134 return
135135 }
136136
137137 const patchUrl = await getPatchUrl ( )
138138 if ( patchUrl ) {
139- mountComponent ( config . github )
139+ mountComponent ( 'github' , config . github )
140140 }
141141 }
142142 }
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
1414 const checkUrlChange = async ( ) => {
1515 if ( location . href !== oldUrl ) {
1616 oldUrl = location . href
17- mountComponent ( config . youtube )
17+ mountComponent ( 'youtube' , config . youtube )
1818 }
1919 }
2020 window . setInterval ( checkUrlChange , 500 )
You can’t perform that action at this time.
0 commit comments