javascript 这个 Chrome 调试器 VM 脚本是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29479714/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 10:36:14  来源:igfitidea点击:

What is this Chrome debugger VM script?

javascriptgoogle-chromegoogle-chrome-devtoolsv8

提问by seangwright

You can find this file by calling dir(obj)in the Chrome dev tools console and clicking the link display on the right pointing to where diris defined in this file.

您可以通过调用dir(obj)Chrome 开发工具控制台并单击右侧显示的指向dir此文件中定义位置的链接来找到此文件。

What are the details behind this file?

这个文件背后的细节是什么?

Is this the script that is part of Chrome's debugger or is it some interface with V8?

这是作为 Chrome 调试器一部分的脚本还是与 V8 的某个接口?

Why is there a 2007 Apple copyright at the top?

为什么顶部有一个2007年的苹果版权?

When I open this file the numeric identifier after VM is always different. Where does the VMXXXX identifier come from?

当我打开这个文件时,VM 之后的数字标识符总是不同的。VMXXXX 标识符从何而来?

Are there anymore of these files publicly visible like this and, if so, how do you access them?

是否还有这些文件像这样公开可见,如果有,您如何访问它们?

Thanks!

谢谢!

Chrome debugger VM script

Chrome 调试器 VM 脚本

回答by Vyacheslav Egorov

This file is part of Dev Tools implementation, which resides within Blink source tree: Source/core/inspector/InjectedScriptSource.js.

该文件是 Dev Tools 实现的一部分,它位于 Blink 源代码树中:Source/core/inspector/InjectedScriptSource.js.

There is Apple copyright because Blink itself is fork of WebKit, at that copyright is retained from there.

有 Apple 版权,因为 Blink 本身是 WebKit 的分支,在那里版权是从那里保留的。

VMxyzidentifiers are generated by devtools themsevles for dynamically injected scripts that have no associated URL. See addScriptmethod in Source/devtools/front_end/bindings/DefaultScriptMapping.js

VMxyz标识符由 devtools themsevles 为没有关联 URL 的动态注入脚本生成。见addScript方法Source/devtools/front_end/bindings/DefaultScriptMapping.js

DevTools have a lot of JavaScript code inside of them, especially when it comes to UI which is all HTML based. Just browse Source/devtools/front_end/folder in Blink Sources.

DevTools 中有很多 JavaScript 代码,尤其是当涉及到完全基于 HTML 的 UI 时。只需Source/devtools/front_end/在 Blink Sources 中浏览文件夹。