diff options
author | portix <none@none> | 2012-09-25 11:28:42 +0200 |
---|---|---|
committer | portix <none@none> | 2012-09-25 11:28:42 +0200 |
commit | 3766f55ac54b228782f82e981416cc06f9b30bb8 (patch) | |
tree | 59a9556d6e3c24176f7525747bc6ed4bde772340 /api | |
parent | f0a3b9d7f5c3ed6cfc067ae7da8c35af334a7b47 (diff) | |
download | dwb-3766f55ac54b228782f82e981416cc06f9b30bb8.zip |
Optional argument for inject function
Diffstat (limited to 'api')
-rw-r--r-- | api/dwb-js.7 | 13 | ||||
-rw-r--r-- | api/jsapi.7.txt | 5 | ||||
-rw-r--r-- | api/jsapi.txt | 7 |
3 files changed, 19 insertions, 6 deletions
diff --git a/api/dwb-js.7 b/api/dwb-js.7 index 1ff194c8..46e78cb8 100644 --- a/api/dwb-js.7 +++ b/api/dwb-js.7 @@ -2,12 +2,12 @@ .\" Title: dwb-js .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/> -.\" Date: 09/13/2012 +.\" Date: 09/25/2012 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "DWB\-JS" "7" "09/13/2012" "\ \&" "\ \&" +.TH "DWB\-JS" "7" "09/25/2012" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1048,7 +1048,7 @@ The number of the webview, starting at 0 .nr an-break-flag 1 .br .ps +1 -\fBString wv.inject(String script, [Boolean global])\fR +\fBString wv.inject(String script, [Object argument], [Boolean global])\fR .RS 4 .sp Injects a script into a webview @@ -1058,6 +1058,13 @@ Injects a script into a webview The script to inject .RE .PP +\fIargument\fR +.RS 4 +If the script isn\(cqt injected into the global scope the script is wrapped inside a function\&. argument then is accesible via +\fIarguments\fR +in the injected script, optional +.RE +.PP \fIglobal\fR .RS 4 true to inject it into the global scope, false to encapsulate it in a function, optional diff --git a/api/jsapi.7.txt b/api/jsapi.7.txt index b8390732..d03cba61 100644 --- a/api/jsapi.7.txt +++ b/api/jsapi.7.txt @@ -486,12 +486,15 @@ _wv.focusedFrame (Frame, read)_;; The focused frame of the webview _wv.mainFrame (Frame, read)_;; The main frame of the webview _wv.number (Number, read)_;; The number of the webview, starting at 0 -==== String wv.inject(String script, [Boolean global]) +==== String wv.inject(String script, [Object argument], [Boolean global]) **** Injects a script into a webview _script_;; The script to inject +_argument_;; If the script isn't injected into the global scope the script is +wrapped inside a function. argument then is accesible via +'arguments' in the injected script, optional _global_;; true to inject it into the global scope, false to encapsulate it in a function, optional _returns_;; The return value of the script. If the script is injected globally diff --git a/api/jsapi.txt b/api/jsapi.txt index 6f96773e..8541ec05 100644 --- a/api/jsapi.txt +++ b/api/jsapi.txt @@ -966,7 +966,7 @@ The number of the webview, starting at 0 [source,javascript] ---- -String wv.inject(String script, [Boolean global]) +String wv.inject(String script, [Object argument], [Boolean global]) ---- Injects a script into a webview @@ -974,6 +974,9 @@ Injects a script into a webview :: _script_;; The script to inject +_argument_;; If the script isn't injected into the global scope the script is +wrapped inside a function. +argument+ then is accesible via ++arguments+ in the injected script, optional _global_;; +true+ to inject it into the global scope, +false+ to encapsulate it in a function, optional _returns_;; The return value of the script. If the script is injected globally @@ -1112,7 +1115,7 @@ can be used. [source,javascript] ---- -Boolean frame.inject(String script, [Boolean global]) +Boolean frame.inject(String script, [Object argument], [Boolean global]) ---- Injects a script into a frame, see also <<inject,webview.inject>> for details. |