From 4f7cf92fcd4978ca3d0916122b7933e5449ba5d1 Mon Sep 17 00:00:00 2001 From: shijian <2954700422@qq.com> Date: Mon, 25 Sep 2023 01:04:27 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20bug=EF=BC=8C=E4=B8=8A=E4=B8=80=E4=B8=AAco?= =?UTF-8?q?mmit=E7=9A=84f**k=E5=BA=94=E8=AF=A5=E6=94=B9=E6=88=90f**king?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/game/game.js b/game/game.js index 0307c5ca2..aebddd109 100644 --- a/game/game.js +++ b/game/game.js @@ -10161,6 +10161,12 @@ let sScriptURL; if(str.indexOf('http')==0) sScriptURL=str; else if(str.startsWith('local:')){ + if(lib.assetURL.length==0&&location.origin=='file://'&&typeof game.readFile=='undefined'){ + const e=new Error('浏览器file协议下无法使用此api,请在http/https协议下使用此api'); + if(typeof onerror=='function') onerror(e); + else throw e; + return; + } sScriptURL=lib.assetURL+str.slice(6); } else{