Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ public String getInstanceId() {
return instanceId;
}

private void resolvePluginCallWithId() {
if (_options == null || _options.getPluginCall() == null) {
return;
}
JSObject result = new JSObject();
result.put("id", instanceId != null ? instanceId : "");
_options.getPluginCall().resolve(result);
}

// Add this class to provide safer JavaScript interface
private class JavaScriptInterface {

Expand Down Expand Up @@ -978,10 +987,10 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
show();
applyHiddenMode();
}
_options.getPluginCall().resolve();
resolvePluginCallWithId();
} else if (!this._options.isPresentAfterPageLoad()) {
show();
_options.getPluginCall().resolve();
resolvePluginCallWithId();
}
}

Expand Down Expand Up @@ -2787,7 +2796,7 @@ public void onPageFinished(WebView view, String url) {
boolean usePreShowScript = _options.getPreShowScript() != null && !_options.getPreShowScript().isEmpty();
if (!usePreShowScript) {
show();
_options.getPluginCall().resolve();
resolvePluginCallWithId();
} else {
executorService.execute(
new Runnable() {
Expand All @@ -2802,7 +2811,7 @@ public void run() {
@Override
public void run() {
show();
_options.getPluginCall().resolve();
resolvePluginCallWithId();
}
}
);
Expand Down