如何使用JavaScript打开开发人员工具?
编辑答案: 在大多数浏览器中,都有一个称为“检查”或“ Inspect element”的函数,可以打开开发人员工具。这使您可以使用许多不同的工具,例如更改DOM,运行JavaScript,查找链接文件的来源,更改CSS和其他内容。该工具集可以用来乱七八糟,也可以用于其他目的,例如在在线测试中作弊。这就是许多学校阻止学生这种功能的原因。作为一个狂热的学习者和程序员,我决定使用其他方法。我想知道我是否可以使用JavaScript打开开发人员工具面板,即使我猜JavaScript无法与浏览器反应,只有页面。如果有“开发人员工具”菜单的JavaScript替代方案,请告诉我。谢谢您的宝贵时间,我真的希望我能回来问问题。对于任何想知道的人,我只能通过书签与页面互动。
Edited answer:
In most browsers, there is a function called "Inspect" or "Inspect element" that opens up the developer tools. This allows you to use many different tools, like changing the DOM, running JavaScript, finding the sources of linked files, change the CSS and other things. This tool set can be used to mess around, but also for other purposes, like cheating on online tests. That is the reason that many schools have blocked this functionality from the students. Being a avid learner and programmer, I decided that I would use other methods. I am wondering whether or not I could use JavaScript to open the Developer tools panel, even though I am guessing that JavaScript can't react with the browser, only the page. If there is a JavaScript alternate for the developer tools menu, please tell me about it. Thank you for your time, I really hope that I get question asking back. For anyone wondering, I am only really able to interact with a page through bookmarklets.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在这里,您可以
粘贴到书签的URL部分,并将其命名为您想要的内容。
here you go
paste into url section of bookmark and name it what you want.
如果它是自定义构建Chrome版本,并且可以禁用甚至删除工具,那么您无能为力。
Chrome接口不受JavaScript的控制,这仅适用于渲染。您可以使用Hotkey(Ctrl+Shift+J或I),F12,右键单击元素或通过接口访问(启用)访问(如果已启用)。
If it's a custom build Chrome version and they disable or even remove the tool, then there is nothing you can do.
Chrome interface is not under control of Javascript, which is only for render. You can access (if is enabled) using hotkeys (Ctrl+Shift+J or I), F12, right click elements or access via the interface.
尝试创建书签并将其称为“检查元素”。然后将此代码分配给创建书签的URL部分:
Try creating a bookmark and calling it 'Inspect Element'. Then assign this code to the URL part of creating the bookmark: