feat: improve web mode notification (#309)

This commit is contained in:
josc146
2023-05-08 15:50:42 +08:00
parent b487c03ab3
commit e95372d77d
12 changed files with 107 additions and 49 deletions
+3 -5
View File
@@ -302,7 +302,7 @@ async function overwriteAccessToken() {
}
async function prepareForForegroundRequests() {
if (location.hostname !== 'chat.openai.com') return
if (location.hostname !== 'chat.openai.com' || location.pathname === '/auth/login') return
const userConfig = await getUserConfig()
@@ -313,10 +313,8 @@ async function prepareForForegroundRequests() {
render(<NotificationForChatGPTWeb container={div} />, div)
await Browser.runtime.sendMessage({
type: 'PIN_TAB',
data: {
saveAsChatgptConfig: true,
},
type: 'SET_CHATGPT_TAB',
data: {},
})
registerPortListener(async (session, port) => {
-14
View File
@@ -315,17 +315,3 @@
background-color: var(--theme-color);
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.2);
}
.chatgptbox-notification {
display: flex;
flex-direction: row;
align-items: center;
gap: 6px;
position: fixed;
top: 25px;
right: 25px;
z-index: 2147483647;
padding: 4px 10px;
border: 1px solid;
border-radius: 4px;
}