File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { AppProvider } from "../store/AppContext.tsx";
1414// 初始化日志组件
1515const loggerCore = new LoggerCore ( {
1616 writer : new MessageWriter ( message ) ,
17- labels : { env : "install " } ,
17+ labels : { env : "popup " } ,
1818} ) ;
1919
2020loggerCore . logger ( ) . debug ( "popup page start" ) ;
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ export function parseStorageValue(str: string): unknown {
8181// https://developer.chrome.com/docs/extensions/reference/api/tabs?hl=en#get_the_current_tab
8282export async function getCurrentTab ( ) : Promise < chrome . tabs . Tab | undefined > {
8383 // `tab` will either be a `tabs.Tab` instance or `undefined`.
84- const [ tab ] = await chrome . tabs . query ( { active : true , lastFocusedWindow : true , windowType : "normal" } ) ;
84+ // 不要使用 windowType: "normal" ,否则在使用应用窗口时获取不到 tab 了
85+ const [ tab ] = await chrome . tabs . query ( { active : true , lastFocusedWindow : true } ) ;
8586 if ( tab ?. discarded ) return undefined ;
8687 return tab ;
8788}
You can’t perform that action at this time.
0 commit comments