admin管理员组文章数量:1415438
I am using chrome console to get data from one site with these 2 mands.
window.location.replace(link);
document.forms[2].submit();
Is there any way to run theme together in the same line or make a loop ?? Because i want to run in many times
I am using chrome console to get data from one site with these 2 mands.
window.location.replace(link);
document.forms[2].submit();
Is there any way to run theme together in the same line or make a loop ?? Because i want to run in many times
Share Improve this question edited Oct 22, 2014 at 8:12 CodingIntrigue 78.7k32 gold badges176 silver badges177 bronze badges asked Oct 22, 2014 at 7:29 SaksooSaksoo 532 silver badges7 bronze badges 6- 2 crate a function and execute it.. – Vicky Gonsalves Commented Oct 22, 2014 at 7:31
- 1 Or just write them one after another: window.location.replace(link); document forms[2].submit(); – Pete TNT Commented Oct 22, 2014 at 7:33
- Or use an IIFE, or use Shift+Enter to drop onto a new line without executing. This is a Chrome issue, not a programming one. – CodingIntrigue Commented Oct 22, 2014 at 7:33
- @RGraham I don't agree: Chrome developer tools is for debugging, so it's a tool for programmers. So the question is not off-topic, in my opinion – Pablo Lozano Commented Oct 22, 2014 at 7:59
- @Pablo Fair point, vote retracted – CodingIntrigue Commented Oct 22, 2014 at 8:00
1 Answer
Reset to default 6Chrome Dev Tools Snippets FTW
Open Dev tools, navigate to the Sources
tab, open the sidebar on the left, and open the Snippets
tab. Now right click and create new snippet, put your code inside it, and run it via Ctrl+Enter
. These snippets stay there untill you delete them, even after chrome restart. They are very powerfull and easy to use.
Read more in the official article Authoring Development Workflow #Snippets
本文标签: javascriptRunning commands from chrome consoleStack Overflow
版权声明:本文标题:javascript - Running commands from chrome console - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745235498a2649017.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论