File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 8888
8989 var fetchProxy = function ( url , options , i ) {
9090 var proxy = [
91- // 'https://cors. io/? ',
92- 'https://jsonp.afeld.me/?url= ' ,
91+ 'https://thingproxy.freeboard. io/fetch/ ' ,
92+ 'https://yacdn.org/serve/ ' ,
9393 'https://cors-anywhere.herokuapp.com/'
9494 ] ;
9595 return fetch ( proxy [ i ] + url , options ) . then ( function ( res ) {
96- if ( ! res . ok )
97- throw new Error ( 'Cannot load ' + url + ': ' + res . status + ' ' + res . statusText ) ;
9896 return res . text ( ) ;
9997 } ) . catch ( function ( error ) {
10098 if ( i === proxy . length - 1 )
104102 } ;
105103
106104 if ( url && url . indexOf ( location . hostname ) < 0 )
107- fetchProxy ( url , null , 0 ) . then ( loadHTML ) . catch ( function ( error ) {
105+ fetch ( url ) . then ( function ( res ) {
106+ if ( ! res . ok ) throw new Error ( 'Cannot load ' + url + ': ' + res . status + ' ' + res . statusText ) ;
107+ return res . text ( ) ;
108+ } ) . then ( loadHTML ) . catch ( function ( error ) {
108109 console . error ( error ) ;
109110 previewForm . style . display = 'block' ;
110111 previewForm . innerText = error ;
You can’t perform that action at this time.
0 commit comments