Is there a way to execute something in the console of a website without opening the DevTools?

huangapple go评论99阅读模式
英文:

Is there a way to execute something in the console of a website without opening the DevTools?

问题

我在想是否有可能执行JavaScript代码或将任何内容发送到网站的控制台,而不必打开DevTools。

比如说,我想在控制台中运行函数debug.start()。然后我必须打开DevTools > 控制台,并在那里输入debug.start()

但假设我想执行这个函数而根本不打开DevTools。
我的意思是,有没有一种代码可以代替我执行函数debug.start()

是否有这样的方法?如果有,那么是否可以使用Python来实现,因为我最擅长Python。

英文:

So I was wondering if it is possible to execute JavaScript code or send anything to the console of a website without opening the DevTools.

Like lets say I would like to run the function debug.start() in the console. Then I have to open the DevTools > Console and send there debug.start().

But let's say that I would like to execute the function without opening the DevTools at all.
I mean a code, that executes the function debug.start() for me.

Is there a way to do so? And if so, then is it possible to do that with Python because I know python the best.

答案1

得分: 1

我认为Tampermonkey是你在寻找的东西。这是一个浏览器扩展,允许你编写JavaScript脚本并在网站或特定页面上执行它们。

这个页面上,你可以找到用户脚本。

英文:

I think Tampermonkey is what you are looking for. This is a browser extension that allows you to write scripts in JavaScript and execute them on websites or on specific pages.

On this page, you can find user scripts.

huangapple
  • 本文由 发表于 2023年7月17日 21:16:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76704865.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定