File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 6161
6262
6363 //go ahead and download dataURLs right away
64- if ( / ^ d a t a \: [ \w + \ -] + \/ [ \w + \ -] + [ , ; ] / . test ( payload ) ) {
64+ if ( / ^ d a t a : ( [ \w + - ] + \/ [ \w + . - ] + ) ? [ , ; ] / . test ( payload ) ) {
6565
6666 if ( payload . length > ( 1024 * 1024 * 1.999 ) && myBlob !== toString ) {
6767 payload = dataUrlToBlob ( payload ) ;
112112
113113 // handle non-a[download] safari as best we can:
114114 if ( / ( V e r s i o n ) \/ ( \d + ) \. ( \d + ) (?: \. ( \d + ) ) ? .* S a f a r i \/ / . test ( navigator . userAgent ) ) {
115- url = url . replace ( / ^ d a t a : ( [ \w \/ \- \+ ] + ) / , defaultMime ) ;
115+ url = url . replace ( / ^ d a t a : ( [ \w \/ \- \+ \. ] + ) / , defaultMime ) ;
116116 if ( ! window . open ( url ) ) { // popup blocked, offer direct download:
117117 if ( confirm ( "Displaying New Document\n\nUse Save As... to download, then click back to return to this page." ) ) { location . href = url ; }
118118 }
124124 document . body . appendChild ( f ) ;
125125
126126 if ( ! winMode ) { // force a mime that will download:
127- url = "data:" + url . replace ( / ^ d a t a : ( [ \w \/ \- \+ ] + ) / , defaultMime ) ;
127+ url = "data:" + url . replace ( / ^ d a t a : ( [ \w \/ \- \+ \. ] + ) / , defaultMime ) ;
128128 }
129129 f . src = url ;
130130 setTimeout ( function ( ) { document . body . removeChild ( f ) ; } , 333 ) ;
159159 }
160160 return true ;
161161 } ; /* end download()*/
162- } ) ) ;
162+ } ) ) ;
You can’t perform that action at this time.
0 commit comments