Java 类android.webkit.JsResult 实例源码
项目:touchtestweb-android
文件:SimpleWebChromeClient.java
@Override
public boolean onJsAlert(final WebView view, final String url, final String message, final JsResult result)
{
new AlertDialog.Builder(m_activity)
.setTitle("Alert")
.setMessage(message)
.setPositiveButton(android.R.string.ok,
new AlertDialog.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
result.confirm();
}
})
.setCancelable(false)
.create()
.show();
return true;
}
项目:AgentWeb
文件:DefaultChromeClient.java
@Override
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
LogUtils.i(TAG, "onJsConfirm:" + message);
if (AgentWebUtils.isOverriedMethod(mWebChromeClient, "onJsConfirm", "public boolean " + ChromePath + ".onJsConfirm", WebView.class, String.class, String.class, JsResult.class)) {
return super.onJsConfirm(view, url, message, result);
}
LogUtils.i(TAG, "mAgentWebUiController:" + mAgentWebUiController.get());
if (mAgentWebUiController.get() != null) {
mAgentWebUiController.get().onJsConfirm(view, url, message, result);
}
// showJsConfirm(message, result);
return true;
}
项目:uikit
文件:XWebChromeClient.java
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
new AlertDialog.Builder(view.getContext())
.setCancelable(false)
.setMessage(message)
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
result.confirm();
dialog.dismiss();
}
})
.create()
.show();
return true;
}
项目:touchtestweb-android
文件:SimpleWebChromeClient.java
@Override
public boolean onJsAlert(final WebView view, final String url, final String message, final JsResult result)
{
new AlertDialog.Builder(m_activity)
.setTitle("Alert")
.setMessage(message)
.setPositiveButton(android.R.string.ok,
new AlertDialog.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
result.confirm();
}
})
.setCancelable(false)
.create()
.show();
return true;
}
项目:Android-JS-Inject
文件:WEBChromeClient.java
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result)
{
return onMyJsAlert(WEBViewImpl.toWEBView(view), url, message, new MyJsResult()
{
@Override
public void cancel()
{
result.cancel();
}
@Override
public void confirm()
{
result.confirm();
}
});
}
项目:AyoSunny
文件:MyWebViewActivity.java
@Override
public boolean onJsAlert(WebView view, String url, String message,
final JsResult result) {
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx);
dlg.setMessage(message);
dlg.setTitle("提示");
// dlg.setTitle(null);
dlg.setCancelable(false);
dlg.setPositiveButton(android.R.string.ok,
new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
result.confirm();
}
});
dlg.create();
dlg.show();
return true;
}
项目:COB
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:COB
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:cordova-vuetify
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:cordova-vuetify
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:BilibiliClient
文件:BrowserActivity.java
@SuppressLint("SetJavaScriptEnabled")
private void setupWebView() {
progressBar.spin();
final WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webSettings.setDomStorageEnabled(true);
webSettings.setGeolocationEnabled(true);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
mWebView.getSettings().setBlockNetworkImage(true);
mWebView.setWebViewClient(webViewClient);
mWebView.requestFocus(View.FOCUS_DOWN);
mWebView.getSettings().setDefaultTextEncodingName("UTF-8");
mWebView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
AlertDialog.Builder b2 = new AlertDialog
.Builder(BrowserActivity.this)
.setTitle(R.string.app_name)
.setMessage(message)
.setPositiveButton("确定", (dialog, which) -> result.confirm());
b2.setCancelable(false);
b2.create();
b2.show();
return true;
}
});
mWebView.loadUrl(url);
}
项目:BilibiliClient
文件:BrowserActivity.java
@SuppressLint("SetJavaScriptEnabled")
private void setupWebView() {
progressBar.spin();
final WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webSettings.setDomStorageEnabled(true);
webSettings.setGeolocationEnabled(true);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
mWebView.getSettings().setBlockNetworkImage(true);
mWebView.setWebViewClient(webViewClient);
mWebView.requestFocus(View.FOCUS_DOWN);
mWebView.getSettings().setDefaultTextEncodingName("UTF-8");
mWebView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
AlertDialog.Builder b2 = new AlertDialog
.Builder(BrowserActivity.this)
.setTitle(R.string.app_name)
.setMessage(message)
.setPositiveButton("确定", (dialog, which) -> result.confirm());
b2.setCancelable(false);
b2.create();
b2.show();
return true;
}
});
mWebView.loadUrl(url);
}
项目:Auto.js
文件:CodeMirrorEditor.java
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
new ThemeColorMaterialDialogBuilder(getContext())
.title(R.string.text_alert)
.content(message)
.onPositive((dialog, which) -> result.confirm())
.cancelListener(dialog -> result.cancel())
.positiveText(R.string.ok)
.show();
return true;
}
项目:buildAPKsApps
文件:JavaScriptWebView.java
@Override
public boolean onJsAlert(
WebView view,
String url,
String message,
JsResult result)
{
// Display alert as a Toast.
Toast.makeText(
view.getContext(),
message,
Toast.LENGTH_SHORT).show();
result.confirm();
return true;
}
项目:keemob
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:keemob
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:keemob
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:keemob
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:alerta-fraude
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:alerta-fraude
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:localcloud_fe
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:localcloud_fe
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:localcloud_fe
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:localcloud_fe
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:siiMobilityAppKit
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:siiMobilityAppKit
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:DinningShare
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:DinningShare
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:AppFirCloud
文件:WebViewActivity.java
private void showAlert(WebView view, String url, String message, final JsResult result) {
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setTitle("")
.setMessage(message)
.setPositiveButton(getString(R.string.confirm), (dialog, which) -> {
result.confirm();
dialog.dismiss();
}).setOnCancelListener(dialog -> result.cancel());
builder.show();
}
项目:hybrid
文件:BaseWebActivity.java
protected void JsAlert(WebView view, String url, String message, final JsResult result) {
AlertDialog.Builder builderAlert = new AlertDialog.Builder(BaseWebActivity.this)
.setTitle("")
.setMessage(message)
.setPositiveButton("ok", new AlertDialog.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
result.confirm();
}
});
builderAlert.setCancelable(false);
builderAlert.create();
builderAlert.show();
}
项目:robotium-extensions
文件:ProxyWebChromeClient.java
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
if (originalWebChromeClient != null) {
return originalWebChromeClient.onJsAlert(view, url, message, result);
} else {
return super.onJsAlert(view, url, message, result);
}
}
项目:robotium-extensions
文件:ProxyWebChromeClient.java
@Override
public boolean onJsBeforeUnload(WebView view, String url, String message, JsResult result) {
if (originalWebChromeClient.onJsBeforeUnload(view, url, message, result)) {
return originalWebChromeClient.onJsBeforeUnload(view, url, message, result);
} else {
return super.onJsBeforeUnload(view, url, message, result);
}
}
项目:robotium-extensions
文件:ProxyWebChromeClient.java
@Override
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
if (originalWebChromeClient != null) {
return originalWebChromeClient.onJsConfirm(view, url, message, result);
} else {
return super.onJsConfirm(view, url, message, result);
}
}
项目:MarkdownEditors
文件:BaseWebActivity.java
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
AlertDialog.Builder builder = new AlertDialog.Builder(view.getContext());
builder.setTitle("注意").setMessage(message).setPositiveButton("确定", null);
builder.setCancelable(false);
AlertDialog dialog = builder.create();
dialog.show();
result.confirm();
return true;
}
项目:RxZhiHu
文件:EditorInfoActivity.java
private void setupWebView() {
final WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webSettings.setDomStorageEnabled(true);
webSettings.setGeolocationEnabled(true);
mWebView.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
mWebView.getSettings().setBlockNetworkImage(true);
mWebView.setWebViewClient(webViewClient);
mWebView.requestFocus(View.FOCUS_DOWN);
mWebView.getSettings().setDefaultTextEncodingName("UTF-8");
mWebView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
AlertDialog.Builder b2 = new AlertDialog.Builder(EditorInfoActivity.this).setTitle(R.string.app_name).setMessage(message).setPositiveButton("确定", new AlertDialog.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
result.confirm();
}
});
b2.setCancelable(false);
b2.create();
b2.show();
return true;
}
});
mWebView.loadUrl(url);
}
项目:resin-configurator-client
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:resin-configurator-client
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:react-native-web-utf8map
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:react-native-web-utf8map
文件:SystemWebChromeClient.java
/**
* Tell the client to display a confirm dialog to the user.
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
项目:HybridAppReduxVsIonic
文件:SystemWebChromeClient.java
/**
* Tell the client to display a javascript alert dialog.
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}