Chrome 开发者工具不再显示所有 JavaScript 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31862344/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Chrome developer tools do not show all JavaScript files any more
提问by Fosna
Not all JavaScript files are visible in Chorme Developer tools any more.
并非所有 JavaScript 文件都在 Chorme Developer 工具中可见。
Google Chrome is up to date. Version 44.0.2403.130 m Debug version of the app. Scripts in the head.
谷歌浏览器是最新的。版本 44.0.2403.130 m 应用程序的调试版本。脑子里的脚本。
<script src="/Scripts/jquery-ui-1.8.24.js"></script>
<script src="/Scripts/jquery.validate.js"></script>
...
<script src="/Client/Statics/GuiContainers.js"></script>
<script src="/Client/ClientDAL.js"></script>
<script src="/Client/ClientLayoutUpdater.js"></script>
<script src="/Client/ClientRenderer.js"></script>
<script src="/Client/ControllerLocator.js"></script>
First part of the scripts is visible in Chrome Developer Tools under Sources menu on localhost/Scripts/* path. Second part of the scripts is not visible since yesterday. What is the matter with the Developer Tools?
脚本的第一部分在 localhost/Scripts/* 路径上的 Sources 菜单下的 Chrome Developer Tools 中可见。自昨天以来,脚本的第二部分不可见。开发者工具有什么问题?
There are no errors in JavaScript console. I can see successful requests for JavaScript files in network tab. All JavaScript is loaded. Application works fine.
JavaScript 控制台中没有错误。我可以在网络选项卡中看到对 JavaScript 文件的成功请求。所有 JavaScript 都已加载。应用程序工作正常。
What is the matter with the Developer Tools? Does anyone have an idea?
开发者工具有什么问题?有没有人有想法?
If I add localhost "folder" to the workspace, everything is visible, even server side source files.
如果我将 localhost “文件夹”添加到工作区,则所有内容都可见,甚至服务器端源文件也是如此。
采纳答案by Fosna
I have reinstalled Chrome with removing Chrome profile data. It works now.
我已经通过删除 Chrome 配置文件数据重新安装了 Chrome。它现在有效。
回答by abiNerd
Opened the network tab in developer tools and pressed F5 to refresh - thanks @Seano666 for your comment on the question
在开发人员工具中打开网络选项卡并按 F5 刷新 - 感谢 @Seano666 对问题的评论
回答by Brendan
For me I just had to open the Developer Tools settings and click on the "Restore defaults and reload" button in the first tab.
对我来说,我只需要打开开发人员工具设置,然后单击第一个选项卡中的“恢复默认值并重新加载”按钮。
Then all my local scripts showed up again and debugging was back to normal.
然后我所有的本地脚本再次出现,调试恢复正常。
回答by John-Perez
Add the debugger;
instruction at any part of your script, the debugger will stop at this point and show you the script, even if the script is dynamically loaded.
debugger;
在脚本的任何部分添加指令,调试器将在此时停止并向您显示脚本,即使脚本是动态加载的。
onSuccess: function (result) {
debugger;
combo.empty();
$(result).each(function () {
var option;
option = document.createElement('option');
option.value = this.Id;
$(option).appendTo(combo);
});
}
回答by Southern Fire
Try right click on reload
button in developer tools.
You'll get a menu from which you can choose: Empty Cache & Hard Reload
.
That worked for me.
尝试右键单击reload
开发人员工具中的按钮。
您将获得一个菜单,您可以从中选择:Empty Cache & Hard Reload
。
那对我有用。
回答by koshy6252
I had the same issue and "Empty cache and hard reload" worked for me.
我遇到了同样的问题,“空缓存和硬重新加载”对我有用。
回答by Tarandeep Singh
The issue is due to network mapping and unmapping. There is some weird bug in chrome dev tools which causes these kind of issues. Some times you might even see, old css files in the side bar and when you open the css file from the left side bar. it would be just blank or even worse, wont even be visible.
该问题是由于网络映射和取消映射造成的。chrome 开发工具中有一些奇怪的错误会导致这些问题。有时您甚至可能会在侧栏中看到旧的 css 文件,当您从左侧栏中打开 css 文件时。它只是空白,甚至更糟,甚至不可见。
Even i have tried all the options. restarting, removing all chache, mapping unmapping. incognito mode. But in the end had to reinstall to make this fix.
即使我已经尝试了所有选项。重新启动,删除所有 chache,映射取消映射。隐身模式。但最终不得不重新安装才能进行此修复。
So go ahead do a fresh chrome install. everything should be Fine.
因此,继续进行全新的 chrome 安装。一切都应该很好。
回答by NiVeR
I have experienced the same issue with a folder not being loaded and I resolved it in the following way:
我遇到了未加载文件夹的相同问题,我通过以下方式解决了它:
In
Sources
mode, click the blue-highlighted button:Select
Open file
.Type the name of the wanted file in the search input box.
Select the file from the result list.
回答by Marcus
Problem: I had been developing/debugging for some time, and then I encountered a similar issue. Even though my console logs showed line numbers, when I clicked them, I was taken to line 1 of a blank page. My scripts were embedded in the html, so I could see them in the Elements tab, but when I opened the file in the Sources tab, it was just blank.
问题:我一直在开发/调试一段时间,然后我遇到了类似的问题。尽管我的控制台日志显示了行号,但当我点击它们时,我被带到了一个空白页面的第 1 行。我的脚本嵌入在 html 中,所以我可以在 Elements 选项卡中看到它们,但是当我在 Sources 选项卡中打开文件时,它只是空白。
Solution: The fix for me was to copy the url address and paste it into a new taband reopen dev tools. The original tab had gotten into a bad state somehow.
解决方案:我的解决方法是复制 url 地址并将其粘贴到新选项卡中,然后重新打开开发工具。原来的标签不知何故进入了一个糟糕的状态。
回答by Onur Kocatas
In my case it was the Chrome cache issue. Refreshing did not work for me. After mapping the file below fixed my issue
就我而言,这是 Chrome 缓存问题。刷新对我不起作用。映射下面的文件后修复了我的问题
1- Open the file on browser e.g. http://example.com/script.js
1- 在浏览器上打开文件,例如http://example.com/script.js
2- Add a version e.g. http://example.com/script.js?v=2
2- 添加一个版本,例如http://example.com/script.js ?v=2
This clears the cache and the file start showing up as editable.
这将清除缓存,文件开始显示为可编辑。
回答by Shiko
I had the same issue and tried mentioned answers, but it turned that Google Chrome updated silently and it needs to be relaunched then everything works well.
我遇到了同样的问题并尝试了提到的答案,但结果是 Google Chrome 以静默方式更新,需要重新启动,然后一切正常。
Enter chrome://settings/help
in your chrome URL and check if it needs relaunching.
输入chrome://settings/help
您的 chrome URL 并检查它是否需要重新启动。