@@ -123,9 +123,8 @@ function onTabCreatedListener (tab) {
123
123
}
124
124
125
125
function onTabUpdatedListener ( tabId , changeInfo , tab ) {
126
- if ( changeInfo . status === 'loading' && tab . active ) {
127
- saveExistFlag ( tab . url , existStates . notexists ) ;
128
- requestExists ( tab . url ) ;
126
+ if ( ( changeInfo . status === 'loading' ) && tab . active ) {
127
+ checkExist ( tab . url ) ;
129
128
}
130
129
}
131
130
@@ -457,8 +456,9 @@ function savePageToWallabag (url, resetIcon) {
457
456
458
457
const GotoWallabag = ( part ) => api . checkParams ( ) && browser . tabs . create ( { url : `${ api . data . Url } /${ part } /list` } ) ;
459
458
460
- const checkExist = ( url ) => {
461
- if ( isServicePage ( url ) ) { return ; }
459
+ const checkExist = ( dirtyUrl ) => {
460
+ if ( isServicePage ( dirtyUrl ) ) { return ; }
461
+ const url = dirtyUrl . split ( '#' ) [ 0 ] ;
462
462
if ( existCache . check ( url ) ) {
463
463
const existsFlag = existCache . get ( url ) ;
464
464
if ( existsFlag === existStates . exists ) {
@@ -491,7 +491,7 @@ const saveExistFlag = (url, exists) => {
491
491
existCache . set ( url , exists ) ;
492
492
} ;
493
493
494
- const isServicePage = ( url ) => RegExp ( '((chrome|about|browser):(.*)|' + api . data . Url + ')' , 'g' ) . test ( url ) ;
494
+ const isServicePage = ( url ) => ! / ^ h t t p s ? : \/ \/ . + / . test ( url ) || RegExp ( '^' + api . data . Url ) . test ( url ) ;
495
495
496
496
const addToAllTags = ( tags ) => {
497
497
if ( tags . length === 0 ) { return ; }
0 commit comments