0adaf089554294e2c37fc703cc4d5e9b58a6f957
[yaffs-website] / commands / javascript / add_extension.md
1 add_extension
2 =============
3 This command allows you to inject an external script code from the specified file into the current page.
4
5 ```json
6 {
7     "name": "add_extension",
8     "args": [
9         "/www/web/script_extensions/extension.js"
10     ]
11 }
12 ```
13 If the script was properly injected the response should be:
14 ```json
15 {
16     "response": "success"
17 }
18 ```
19 For more details on how this works check [PhantomJS injectJS documentation](http://phantomjs.org/api/webpage/method/inject-js.html)