File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import type { UpdatePayload } from './typings/webpage-message';
66
77let enabledTab = new Set < number > ( ) ;
88let tabData = new Map < number , Record < string , UpdatePayload [ 'data' ] > > ( ) ;
9- let pervTabUrl = new Map < number , string > ( ) ;
109
1110const cleanupCache = ( tabId : number ) => {
1211 if ( enabledTab . has ( tabId ) ) {
@@ -15,16 +14,10 @@ const cleanupCache = (tabId: number) => {
1514 if ( tabData . has ( tabId ) ) {
1615 tabData . delete ( tabId ) ;
1716 }
18- if ( pervTabUrl . has ( tabId ) ) {
19- pervTabUrl . delete ( tabId ) ;
20- }
2117} ;
2218
23- chrome . tabs . onUpdated . addListener ( ( tabId , _ , tab ) => {
24- if ( pervTabUrl . get ( tabId ) ! !== tab . url ) {
25- cleanupCache ( tabId ) ;
26- }
27- pervTabUrl . set ( tabId , tab . url ! ) ;
19+ chrome . tabs . onUpdated . addListener ( ( tabId ) => {
20+ cleanupCache ( tabId ) ;
2821 addExtensionMessageListener ( ( message ) => {
2922 switch ( message . type ) {
3023 case 'WELCOME' : {
You can’t perform that action at this time.
0 commit comments