简体   繁体   English

使用带有phonegap的javascript源映射

[英]Use javascript source-maps with phonegap

we are shipping a Cordova WebApp for tablets with minified source using uglify2-compressor via grunt-contrib-requirejs. 我们正在通过grunt-contrib-requirejs使用uglify2-compressor为缩小来源的平板电脑提供Cordova WebApp。 We generate source-maps for debugging which work flawlessly using the chrome desktop browser via remote Debugging on a KitKat Android Tablet. 我们生成用于调试的源映射,通过KitKat Android平板电脑上的远程调试,使用chrome桌面浏览器完美运行。

Now we like to send error reports from our customers to our server. 现在我们希望将客户的错误报告发送到我们的服务器。 The Android WebView does not seem to care about our source maps. Android WebView似乎并不关心我们的源地图。 Therefore we get error message like "line 1, char 1231231" - not very helpful... 因此我们收到错误消息,如“第1行,char 1231231” - 不是很有帮助......

The Question is: Is it possible to use source-maps with the Android (and iOS) Webview maybe using a Cordova plugin or do we have to wait for an update (Chrome and Firefox Desktop are able to parse the maps...) and ship un-minifies code so that we are able to get the line number of the occurred error? 问题是:是否可以使用Android(和iOS)Webview的源映射可能使用Cordova插件,或者我们是否必须等待更新(Chrome和Firefox桌面能够解析地图...)和ship un-minifies代码,以便我们能够获得发生错误的行号?

From Chromium discuss topic 来自Chromium讨论主题

DevTools downloads source maps using the front-end browser, not the one that runs the inspected page. DevTools使用前端浏览器下载源映射,而不是运行被检查页面的源映射。 So file://android... is never going to be accessible. 所以file:// android ...永远不会被访问。 You need to point to the files on your development box instead. 您需要指向开发框中的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM