@@ -536,17 +536,18 @@ class Background {
536536 }
537537
538538 function isLocal ( url ) {
539- if ( url . hostname === "localhost" ||
540- url . hostname === "localhost.localdomain" ||
541- url . hostname === "localhost6" ||
542- url . hostname === "localhost6.localdomain6" ) {
543- return true ;
544- }
545- const localports = / ( ^ 1 2 7 \. ) | ( ^ 1 9 2 \. 1 6 8 \. ) | ( ^ 1 0 \. ) | ( ^ 1 7 2 \. 1 [ 6 - 9 ] \. ) | ( ^ 1 7 2 \. 2 [ 0 - 9 ] \. ) | ( ^ 1 7 2 \. 3 [ 0 - 1 ] \. ) | ( ^ : : 1 $ ) | ( ^ [ f F ] [ c C d D ] ) / ;
546- if ( localports . test ( url . hostname ) ) {
547- return true ;
548- }
549- return false ;
539+ let hostname = url . hostname ;
540+ return ( / ( .+ \. ) ? l o c a l h o s t $ / . test ( hostname ) ||
541+ / ( .+ \. ) ? l o c a l h o s t 6 $ / . test ( hostname ) ||
542+ / ( .+ \. ) ? l o c a l h o s t .l o c a l d o m a i n $ / . test ( hostname ) ||
543+ / ( .+ \. ) ? l o c a l h o s t 6 .l o c a l d o m a i n 6 $ / . test ( hostname ) ||
544+ / ^ 1 2 7 \. \d { 1 , 3 } \. \d { 1 , 3 } \. \d { 1 , 3 } $ / . test ( hostname ) ||
545+ / ^ 1 9 2 \. 1 6 8 \. \d { 1 , 3 } \. \d { 1 , 3 } $ / . test ( hostname ) ||
546+ / ^ 1 0 \. \d { 1 , 3 } \. \d { 1 , 3 } \. \d { 1 , 3 } $ / . test ( hostname ) ||
547+ / ^ 1 7 2 \. 1 [ 6 - 9 ] \. \d { 1 , 3 } \. \d { 1 , 3 } $ / . test ( hostname ) ||
548+ / ^ 1 7 2 \. 2 [ 0 - 9 ] \. \d { 1 , 3 } \. \d { 1 , 3 } $ / . test ( hostname ) ||
549+ / ^ 1 7 2 \. 3 [ 0 - 1 ] \. \d { 1 , 3 } \. \d { 1 , 3 } $ / . test ( hostname ) ||
550+ / \[ [ 0 : ] + 1 \] / . test ( hostname ) ) ;
550551 }
551552
552553 // We want to continue the sending of requests to the proxy even if we
0 commit comments