File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 55 name: unique name for this rule
66 url: regex for url that this rule support
77 src: regex for img src that this rule support
8+ exclude: regex for img src that this rule should not support
89 r: regex(s) for string that will be replaced
9- s: regex(s) for string that will be added
10+ s: regex(s) / function(s) to calculate string that will be added
1011}
1112*/
1213
@@ -76,11 +77,8 @@ export default [
7677 {
7778 name : "font gstatic" ,
7879 src : / ^ h t t p s ? : \/ \/ f o n t s \. g s t a t i c \. c o m \/ ( .* ) \/ n o t o e m o j i / i,
79- r : [
80- / ( h t t p s ? : \/ \/ .* ) \/ \d + .( p n g | j p g ) / ,
81- / ( h t t p s ? : \/ \/ .* ) \/ \d + .( p n g | j p g ) ( .* ?) ( = s \d + ) / ,
82- ] ,
83- s : [ "$1/512.$2" ] ,
80+ r : / ( h t t p s ? : \/ \/ .* ) \/ \d + .( p n g | j p g ) ( .* ?) ( = s \d + ) ? / ,
81+ s : "$1/512.$2" ,
8482 } ,
8583 {
8684 name : "artstation" ,
Original file line number Diff line number Diff line change @@ -1537,7 +1537,7 @@ async function isImageSrc(src) {
15371537 const res = await fetchByPassOrigin ( src , {
15381538 method : "HEAD" ,
15391539 } ) ;
1540- if ( res . ok ) {
1540+ if ( res ? .ok ) {
15411541 // const type = res.headers.get("content-type");
15421542 const type = res . headers ?. [ "content-type" ] ;
15431543 if ( type && type . startsWith ( "image/" ) ) {
You can’t perform that action at this time.
0 commit comments