Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug logs #30

Closed
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 @@ -737,11 +737,15 @@ public void setOnContentSizeChange(RNCWebViewContainer view, boolean sendContent

@ReactProp(name = "mixedContentMode")
public void setMixedContentMode(RNCWebViewContainer view, @Nullable String mixedContentMode) {
Log.d("pikachu", "setMixedContentMode 000");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (mixedContentMode == null || "never".equals(mixedContentMode)) {
view.ifHasRNCWebView(webView -> webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_NEVER_ALLOW));
} else if ("always".equals(mixedContentMode)) {
view.ifHasRNCWebView(webView -> webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW));
view.ifHasRNCWebView((webView) -> {
Log.d("pikachu", "setting mixed content mode to always allow");
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
});
} else if ("compatibility".equals(mixedContentMode)) {
view.ifHasRNCWebView(webView -> webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE));
}
Expand Down Expand Up @@ -831,6 +835,7 @@ public void setAllowsProtectedMedia(WebView view, boolean enabled) {

@Override
protected void addEventEmitters(ThemedReactContext reactContext, RNCWebViewContainer view) {
Log.d("pikachu", "add event emitters. setting web view client");
// Do not register default touch emitter and let WebView implementation handle touches
view.ifHasRNCWebView(webView -> webView.setWebViewClient(new RNCWebViewClient()));
}
Expand Down Expand Up @@ -1109,6 +1114,7 @@ public void setBasicAuthCredential(@Nullable BasicAuthCredential credential) {
@Nullable
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
Log.d("pikachu", "shouldInterceptRequest. request: " + request);
if (webViewAssetLoader == null) {
return super.shouldInterceptRequest(view, request);
}
Expand All @@ -1132,6 +1138,7 @@ public void onPageFinished(WebView webView, String url) {
@Override
public void onPageStarted(WebView webView, String url, Bitmap favicon) {
super.onPageStarted(webView, url, favicon);
Log.d("pikachu", "onPageStarted. url: " + url);
mLastLoadFailed = false;

RNCWebView reactWebView = (RNCWebView) webView;
Expand All @@ -1146,6 +1153,7 @@ public void onPageStarted(WebView webView, String url, Bitmap favicon) {

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.d("pikachu", "shouldOVerrideUrlLoading String URL");
final RNCWebView RNCWebView = (RNCWebView) view;
final boolean isJsDebugging = ((ReactContext) view.getContext()).getJavaScriptContextHolder().get() == 0;

Expand Down Expand Up @@ -1196,6 +1204,7 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
@TargetApi(Build.VERSION_CODES.N)
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
Log.d("pikachu", "shouldOVerrideUrlLoading String web resource request");
final String url = request.getUrl().toString();
return this.shouldOverrideUrlLoading(view, url);
}
Expand Down Expand Up @@ -1862,8 +1871,10 @@ protected void onSizeChanged(int w, int h, int ow, int oh) {

@Override
public void setWebViewClient(WebViewClient client) {
Log.d("pikachu", "setWebViewClient 000");
super.setWebViewClient(client);
if (client instanceof RNCWebViewClient) {
Log.d("pikachu", "setWebViewClient 111");
mRNCWebViewClient = (RNCWebViewClient) client;
mRNCWebViewClient.setProgressChangedFilter(progressChangedFilter);
}
Expand Down
Loading