How to inject JavaScript snippet via Firebug on page load?

一个人想着一个人 提交于 2019-12-08 12:45:35

问题


I want to inject a JavaScript snippet in the Firebug Command Editor while opening a new tab and execute it.

Here is the explanation.

Now the real issue begins. When a page is opened I want a snippet to appear in the Command Editor. So I only have to click on Run. If possible, if clicking Run can be automatized then it would be great.

The purpose is automatize the process of accepting all the requests, which I currently have to do manually.


回答1:


Firebug allows to include and execute external JavaScript files via its include() command. This command also allows you to provide an alias for the script, so you can use that one instead of the script's URL.

The syntax of the command for including the script (and storing an alias for it) looks like this:

include(url[, alias])

where url is the URL string of the script you want to include and alias the optional alias string for the URL.

If you stored an alias for it, you can then call it like this:

include(alias)

If you want to see a list of all aliases, you can call the command without parameters:

include()

And to remove an alias you have to call the command like this:

include(null, alias)

Firebug (up to 2.0) doesn't provide storing arbitrary snippets entered into its Command Editor yet, though. This feature is suggested as issue 6951 as UI for the Command Editor and as a command in issue 6201.

Also automatic execution of JavaScript on page load isn't implemented yet. This is requested in issue 6303.



来源:https://stackoverflow.com/questions/23993438/how-to-inject-javascript-snippet-via-firebug-on-page-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!