简体   繁体   English

在Safari执行之前修改javascript

[英]modify javascript before it gets executed by Safari

I read some old questions about Live Edit in Safari. 我在Safari中阅读了一些关于Live Edit的旧问题。 There was an option to set a breakpoint, double click on the line and edit the code. 可以选择设置断点,双击该行并编辑代码。 I am double clicking the code right now, but no luck. 我现在双击代码,但没有运气。 How can I edit the javascript code before it gets executed in Safari? 如何在Safari中执行之前编辑javascript代码? Through extensions or in some other way? 通过扩展或以其他方式?

In safari, it is not possible to edit the javascript code as you do in other browsers (eg chrome). 在safari中,无法像在其他浏览器中那样编辑javascript代码(例如chrome)。 But you can modify the variable values using Developer Tools in safari (to open: ATL+CTRL+C or Command+Option+C on Mac). 但您可以使用safari中的Developer Tools 修改变量值(在Mac上打开: ATL+CTRL+CCommand+Option+C )。 All you need to do is apply breakpoints at appropriate lines and modify the variables using console in Developer Tools. 您需要做的就是在适当的行应用断点 ,并使用开发人员工具中的控制台修改变量。

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

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