开发者

Javascript doesn't run when loading file from local disk on Android

开发者 https://www.devze.com 2023-03-10 12:48 出处:网络
While trying to develop some Android app I ran into t开发者_如何学运维he following problem: I load an swf file to a WebView, that makes js calls. I want to catch those js calls, so I use WebViews.addJ

While trying to develop some Android app I ran into t开发者_如何学运维he following problem: I load an swf file to a WebView, that makes js calls. I want to catch those js calls, so I use WebViews.addJavascriptInterface() to do so. Everything worked just fine when i loaded the swf file from a remote server, but when I load the same swf file form the Android file system, the javascript methods seem not to run (at least I cannot see them).

Any ideas what can cause this issue?

I don't speak js, but as far as I know in both case the js runs on client size.

Thanks for any advice.


I think it's because of the Flash sandbox. When you run a file locally you can not run Javascript code as it does things outside the SWF. However running it from a remote server has the sandbox privileges of the domain. Check this link for more detail: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e3f.html

0

精彩评论

暂无评论...
验证码 换一张
取 消