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 88
88
89
89
var fetchProxy = function ( url , options , i ) {
90
90
var proxy = [
91
- // 'https://cors. io/? ',
92
- 'https://jsonp.afeld.me/?url= ' ,
91
+ 'https://thingproxy.freeboard. io/fetch/ ' ,
92
+ 'https://yacdn.org/serve/ ' ,
93
93
'https://cors-anywhere.herokuapp.com/'
94
94
] ;
95
95
return fetch ( proxy [ i ] + url , options ) . then ( function ( res ) {
96
- if ( ! res . ok )
97
- throw new Error ( 'Cannot load ' + url + ': ' + res . status + ' ' + res . statusText ) ;
98
96
return res . text ( ) ;
99
97
} ) . catch ( function ( error ) {
100
98
if ( i === proxy . length - 1 )
104
102
} ;
105
103
106
104
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 ) {
108
109
console . error ( error ) ;
109
110
previewForm . style . display = 'block' ;
110
111
previewForm . innerText = error ;
You can’t perform that action at this time.
0 commit comments