Skip to content

Commit e828adb

Browse files
Update version and change script source URLs
1 parent ae55e79 commit e828adb

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

scripts/script.js

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*****YTPRO*******
22
Author: Prateek Chaubey
3-
Version: 3.9.2
3+
Version: 3.9.5
44
URI: https://github.com/prateek-chaubey/YTPRO
5-
Last Updated On: 25 Oct , 2025 , 12:01 IST
5+
Last Updated On: 14 Nov , 2025 , 15:57 IST
66
*/
77

88

@@ -20,7 +20,7 @@ s2: PN51tJhZscE
2020
*/
2121
if(window.eruda == null && localStorage.getItem("devMode") == "true"){
2222
//ERUDA
23-
window.location.href=`javascript:(function () { var script = document.createElement('script'); script.src="//cdn.jsdelivr.net/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init();} })();`;
23+
window.location.href=`javascript:(function () { var script = document.createElement('script'); script.src="//youtube.com/ytpro_cdn/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init();} })();`;
2424
}
2525
/**/
2626

@@ -58,10 +58,11 @@ var sens=0.005;
5858
var vol=Android.getVolume();
5959
var brt = Android.getBrightness()/100;
6060

61-
if(localStorage.getItem("saveCInfo") == null || localStorage.getItem("gesC") == null || localStorage.getItem("bgplay") == null){
61+
if(localStorage.getItem("saveCInfo") == null || localStorage.getItem("gesC") == null || localStorage.getItem("gesM") == null || localStorage.getItem("bgplay") == null){
6262
localStorage.setItem("autoSpn","true");
6363
localStorage.setItem("bgplay","true");
6464
localStorage.setItem("gesC","true");
65+
localStorage.setItem("gesM","false");
6566
localStorage.setItem("fzoom","false");
6667
localStorage.setItem("saveCInfo","true");
6768
localStorage.setItem("geminiModel","2.5 Flash");
@@ -225,18 +226,18 @@ var addSettingsTab=()=>{
225226
if(document.getElementById("setDiv") == null){
226227
var setDiv=document.createElement("div");
227228
setDiv.setAttribute("style",`
228-
height:30px;width:30px;
229229
z-index:9999999999;
230230
font-size:22px;
231-
text-align:center;line-height:35px;
231+
text-align:center;
232+
line-height:35px;
233+
pointer-events:auto;
232234
`);
233235
setDiv.setAttribute("id","setDiv");
234-
var svg=document.createElement("div");
236+
var svg=document.createElement("ytm-pivot-bar-item-renderer");
235237
svg.innerHTML=`<svg fill="${ window.location.href.indexOf("watch") < 0 ? c : "#fff" }" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" id="hSett"><path d="M12.844 1h-1.687a2 2 0 00-1.962 1.616 3 3 0 01-3.92 2.263 2 2 0 00-2.38.891l-.842 1.46a2 2 0 00.417 2.507 3 3 0 010 4.525 2 2 0 00-.417 2.507l.843 1.46a2 2 0 002.38.892 3.001 3.001 0 013.918 2.263A2 2 0 0011.157 23h1.686a2 2 0 001.963-1.615 3.002 3.002 0 013.92-2.263 2 2 0 002.38-.892l.842-1.46a2 2 0 00-.418-2.507 3 3 0 010-4.526 2 2 0 00.418-2.508l-.843-1.46a2 2 0 00-2.38-.891 3 3 0 01-3.919-2.263A2 2 0 0012.844 1Zm-1.767 2.347a6 6 0 00.08-.347h1.687a4.98 4.98 0 002.407 3.37 4.98 4.98 0 004.122.4l.843 1.46A4.98 4.98 0 0018.5 12a4.98 4.98 0 001.716 3.77l-.843 1.46a4.98 4.98 0 00-4.123.4A4.979 4.979 0 0012.843 21h-1.686a4.98 4.98 0 00-2.408-3.371 4.999 4.999 0 00-4.12-.399l-.844-1.46A4.979 4.979 0 005.5 12a4.98 4.98 0 00-1.715-3.77l.842-1.459a4.98 4.98 0 004.123-.399 4.981 4.981 0 002.327-3.025ZM16 12a4 4 0 11-7.999 0 4 4 0 018 0Zm-4 2a2 2 0 100-4 2 2 0 000 4Z"></path></svg>
236238
`;
237239
setDiv.appendChild(svg);
238-
insertAfter(document.getElementsByTagName("ytm-home-logo")[0],setDiv);
239-
240+
insertAfter(document.getElementsByTagName("ytm-home-logo")[0],setDiv)
240241
if(document.getElementById("hSett") != null){
241242
document.getElementById("hSett").addEventListener("click",
242243
function(ev){
@@ -711,6 +712,8 @@ ytpSetI.innerHTML+=`<br><b style='font-size:18px' >YT PRO Settings</b>
711712
<br>
712713
<div>Gesture Controls <span onclick="sttCnf(this,'gesC');" style="${sttCnf(0,0,"gesC")}" ><b style="${sttCnf(0,1,"gesC")}"></b></span></div>
713714
<br>
715+
<div>Miniplayer Gesture <span onclick="sttCnf(this,'gesM');" style="${sttCnf(0,0,"gesM")}" ><b style="${sttCnf(0,1,"gesM")}"></b></span></div>
716+
<br>
714717
<div>Force Zoom <span onclick="sttCnf(this,'fzoom');" style="${sttCnf(0,0,"fzoom")}" ><b style="${sttCnf(0,1,"fzoom")}" ></b></span></div>
715718
<br>
716719
<div>Background Play <span onclick="sttCnf(this,'bgplay');" style="${sttCnf(0,0,"bgplay")}" ><b style="${sttCnf(0,1,"bgplay")}" ></b></span></div>
@@ -840,9 +843,9 @@ updateModel();
840843
Android.showToast("Your app is up to date");
841844
}
842845

843-
fetch('https://cdn.jsdelivr.net/npm/ytpro', {cache: 'reload'});
844-
fetch('https://cdn.jsdelivr.net/npm/ytpro/bgplay.js', {cache: 'reload'});
845-
fetch('https://cdn.jsdelivr.net/npm/ytpro/innertube.js', {cache: 'reload'});
846+
fetch('https://youtube.com/ytpro_cdn/npm/ytpro', {cache: 'reload'});
847+
fetch('https://youtube.com/ytpro_cdn/npm/ytpro/bgplay.js', {cache: 'reload'});
848+
fetch('https://youtube.com/ytpro_cdn/npm/ytpro/innertube.js', {cache: 'reload'});
846849
}
847850

848851

@@ -914,7 +917,7 @@ document.getElementById("volS").remove();
914917
if(localStorage.getItem("devMode") == "false"){
915918
try{eruda.destroy();}catch{}
916919
}else{
917-
window.location.href=`javascript:(function () { var script = document.createElement('script'); script.src="//cdn.jsdelivr.net/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init();} })();`;
920+
window.location.href=`javascript:(function () { var script = document.createElement('script'); script.src="//youtube.com/ytpro_cdn/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init();} })();`;
918921
}
919922

920923

@@ -1100,7 +1103,7 @@ document.body.addEventListener('touchend', e => {
11001103

11011104
touchendY = e.changedTouches[0].screenY;
11021105

1103-
if((e.target.className.toString().includes("video-stream") || e.target.className.toString().includes("player-controls-background")) && !document.fullscreenElement){
1106+
if((e.target.className.toString().includes("video-stream") || e.target.className.toString().includes("player-controls-background")) && !document.fullscreenElement && localStorage.getItem("gesM") == "true"){
11041107
checkDirection();
11051108
}
11061109

@@ -1169,7 +1172,7 @@ window.location.href=e.destination.url;
11691172
var script = doc.createElement("script");
11701173
var scriptSource=`window.addEventListener('DOMContentLoaded', function() {
11711174
var script2 = document.createElement('script');
1172-
script2.src="//cdn.jsdelivr.net/npm/ytpro";
1175+
script2.src="//youtube.com/ytpro_cdn/npm/ytpro";
11731176
document.body.appendChild(script2);
11741177
});
11751178
`;
@@ -1184,7 +1187,7 @@ window.location.href=e.destination.url;
11841187
var script = doc.createElement("script");
11851188
var scriptSource=`window.addEventListener('DOMContentLoaded', function() {
11861189
var script2 = document.createElement('script');
1187-
script2.src="//cdn.jsdelivr.net/npm/ytpro";
1190+
script2.src="//youtube.com/ytpro_cdn/npm/ytpro";
11881191
document.body.appendChild(script2);
11891192
});
11901193
`;
@@ -1448,7 +1451,7 @@ Android.getSNlM0e(secured);
14481451
GeminiAT=await callbackSNlM0e();
14491452

14501453
var sd = document.createElement('script');
1451-
sd.src="//cdn.jsdelivr.net/npm/showdown/dist/showdown.min.js";
1454+
sd.src="//youtube.com/ytpro_cdn/npm/showdown/dist/showdown.min.js";
14521455
document.body.appendChild(sd);
14531456

14541457
}
@@ -1520,6 +1523,7 @@ document.getElementById("diskl").innerHTML=dislikes;
15201523
try{
15211524

15221525
if(localStorage.getItem("gesC") == "true"){
1526+
15231527

15241528
var v= document.getElementById("player-container-id");
15251529
var rect=v.getBoundingClientRect();
@@ -1625,6 +1629,7 @@ el.style.opacity="0";
16251629

16261630
}
16271631

1632+
16281633

16291634
}catch(e){
16301635
console.log(e)
@@ -1825,6 +1830,11 @@ PIPlayer(true);
18251830
}else if(window.location.href.indexOf("youtube.com/shorts") > -1){
18261831

18271832

1833+
let b = document.getElementById("brtS");
1834+
let v = document.getElementById("volS");
1835+
if (b) b.remove();
1836+
if (v) v.remove();
1837+
18281838

18291839
if(document.getElementById("ytproMainSDivE") == null){
18301840
var ys=document.createElement("div");
@@ -2451,7 +2461,7 @@ Ve.style.transform="scale(1)";
24512461
/*Mutation Observer*/
24522462
//as i have been developing YTPRO for almost 4 years now
24532463
//thus it still contains the code which i used when i was a
2454-
//total noob in copy pasting , that time i wasn't aware of
2464+
//totally noob in copy pasting , that time i wasn't aware of
24552465
//plenty of things and by which i used `setInterval` instead
24562466
//of mutation observer , i shall be optimizing the code in future
24572467
//releases but rn only a few code blocks will be in the obesrver

0 commit comments

Comments
 (0)