File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 99 */
1010const debug = false ;
1111
12+ /**
13+ * The CDN to fetch the GDAPI files from
14+ */
15+ const CDN = "https://cdn.jsdelivr.net/gh/arthuro555/gdmod@8ec6b07e41cedc8c23b5708d8ed468bffbe6fb0c/API/" ;
16+
1217/**
1318 * Flag telling if that page got patched already.
1419 */
@@ -18,20 +23,20 @@ let isPatched = false;
1823 * Installs the modding API.
1924 */
2025function installGDModAPI ( ) {
21- return fetch ( "https://cdn.jsdelivr.net/gh/arthuro555/gdmod/API/ includes.json")
26+ return fetch ( CDN + " includes.json")
2227 . then ( req => req . json ( ) )
2328 . then ( includes => {
2429 return new Promise ( ( resolve ) => {
2530 let loaded = 0 ;
2631 for ( let include of includes ) {
2732 if ( debug ) console . log ( `Loading ${ include } ` ) ;
2833 const script = document . createElement ( "script" ) ;
29- script . src = `https://cdn.jsdelivr.net/gh/arthuro555/gdmod/API/ ${ include } ` ;
34+ script . src = CDN + include ;
3035 script . onload = function ( ) {
3136 if ( ++ loaded === includes . length ) {
3237 resolve ( ) ;
3338 }
34- document . body . removeChild ( script ) ; // Cleanup document after loading API.
39+ if ( ! debug ) document . body . removeChild ( script ) ; // Cleanup document after loading API.
3540 }
3641 document . body . appendChild ( script ) ;
3742 }
You can’t perform that action at this time.
0 commit comments