“当场执行”Javascript代码在Chrome中? [英] Executing Javascript code "on the spot" in Chrome?

查看:104
本文介绍了“当场执行”Javascript代码在Chrome中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含许多文本框的chrome页面,我希望自动向它们提供值。我已经有名称 - 值对列表,所以如果我可以简单地在formdocument.getElementsByName(NAME)[0] .value = VALUE;)上执行一系列Javascript命令,我会完成(我希望...)

所以问题是 - 我可以在现场运行JS代码,还是必须使用内容脚本不知何故?

解决方案

右键点击页面并选择'检查元素'。在现在打开的屏幕中(开发人员工具),点击左下角的第二个图标打开一个控制台,您可以在其中键入javascript。控制台链接到当前页面。


I have a page in chrome which contains many textboxes and I wish to feed values automatically to them. I already have the list of name-value pairs, so if I could simple execute a series of Javascript commands on the form "document.getElementsByName(NAME)[0].value = VALUE;" I'll be done (I hope...)

So the question is - can I run a JS code "on the spot", or do I have to use a content script somehow?

解决方案

Right click on the page and choose 'inspect element'. In the screen that opens now (the developer tools), clicking the second icon from the left @ the bottom of it opens a console, where you can type javascript. The console is linked to the current page.

这篇关于“当场执行”Javascript代码在Chrome中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆