以前在使用 requirejs 时遇到过加载的 js 无法在控制台调试的情况,今天做了下总结 - 创建了 script 标签引入的 js 在 FF,Chrome 都能在调试器里找到。 - Web Worker 引入的 js 无法直接在 FF,Chrome 的调试器里找到,需要在: Chrome 中:在引入的 js 文件顶部加上`//@ sourceURL=async_test.js`,然后就能在 (no domain) 中找到该 js FF 中:怎么处理还不会。。。 eg: test.html ```html Document ``` async_test.js ```js //@ sourceURL=async_test.js console.log("async_test"); importScripts("./async_test2.js"); ``` async_test2.js ```js //@ sourceURL=async_test2.js console.log("async_test2"); ```

相关文章:

  • 2021-12-31
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-10-20
  • 2021-10-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2021-03-31
  • 2022-01-06
  • 2021-08-20
  • 2021-07-18
相关资源
相似解决方案