CB-8661 Return executed script result on Windows
This commit is contained in:
parent
c85cab15b7
commit
16353c3466
@ -349,6 +349,10 @@ The function is passed an `InAppBrowserEvent` object.
|
||||
|
||||
- only __code__ key is supported.
|
||||
|
||||
### Windows Quirks
|
||||
|
||||
Due to [MSDN docs](https://msdn.microsoft.com/en-us/library/windows.ui.xaml.controls.webview.invokescriptasync.aspx) the invoked script can return only string values, otherwise the parameter, passed to __callback__ will be `[null]`.
|
||||
|
||||
## insertCSS
|
||||
|
||||
> Injects CSS into the `InAppBrowser` window.
|
||||
|
@ -242,7 +242,10 @@ var IAB = {
|
||||
|
||||
if (isWebViewAvailable && browserWrap && popup) {
|
||||
var op = popup.invokeScriptAsync("eval", code);
|
||||
op.oncomplete = function () { hasCallback && win([]); };
|
||||
op.oncomplete = function (e) {
|
||||
var result = [e.target.result];
|
||||
hasCallback && win(result);
|
||||
};
|
||||
op.onerror = function () { };
|
||||
op.start();
|
||||
}
|
||||
@ -261,7 +264,10 @@ var IAB = {
|
||||
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).done(function (file) {
|
||||
Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
|
||||
var op = popup.invokeScriptAsync("eval", code);
|
||||
op.oncomplete = function () { hasCallback && win([]); };
|
||||
op.oncomplete = function(e) {
|
||||
var result = [e.target.result];
|
||||
hasCallback && win(result);
|
||||
};
|
||||
op.onerror = function () { };
|
||||
op.start();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user