From de3500b90dc0e5da3a529c7e3738dbdf757b0c17 Mon Sep 17 00:00:00 2001 From: Prateek Chaubey <41151614+prateek-chaubey@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:48:36 +0530 Subject: [PATCH] Update MainActivity.java --- .../main/java/com/google/android/youtube/pro/MainActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/google/android/youtube/pro/MainActivity.java b/app/src/main/java/com/google/android/youtube/pro/MainActivity.java index ae203b9..fb44f13 100644 --- a/app/src/main/java/com/google/android/youtube/pro/MainActivity.java +++ b/app/src/main/java/com/google/android/youtube/pro/MainActivity.java @@ -76,6 +76,8 @@ public void onPageStarted(WebView p1, String p2, Bitmap p3) { @Override public void onPageFinished(WebView p1, String url) { + + web.loadUrl("javascript:if (window.trustedTypes && window.trustedTypes.createPolicy) {window.trustedTypes.createPolicy('default', {createHTML: (string) => string,createScriptURL: string => string, createScript: string => string, });}"); web.loadUrl("javascript:(function () { var script = document.createElement('script'); script.src='https://cdn.jsdelivr.net/npm/ytpro'; document.body.appendChild(script); })();"); web.loadUrl("javascript:(function () { var script = document.createElement('script'); script.src='https://cdn.jsdelivr.net/npm/ytpro/bgplay.js'; document.body.appendChild(script); })();"); if(dl){