Skip to content

Commit cd86ed3

Browse files
committed
Prevent recaptcha webview from keeping youtube loaded in background
After the cookies are extracted from the recaptcha webview make it load an empty page to prevent youtube being loaded unecessarily in the background.
1 parent fd4e1b8 commit cd86ed3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

app/src/main/java/org/schabi/newpipe/error/ReCaptchaActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ private void saveCookiesAndFinish() {
162162
setResult(RESULT_OK);
163163
}
164164

165+
// Navigate to blank page (unloads youtube to prevent background playback)
166+
recaptchaBinding.reCaptchaWebView.loadData("", "text/html", null);
167+
165168
final Intent intent = new Intent(this, org.schabi.newpipe.MainActivity.class);
166169
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
167170
NavUtils.navigateUpTo(this, intent);

0 commit comments

Comments
 (0)