diff --git a/bin/update.json b/bin/update.json index 983c315..8db0cee 100644 --- a/bin/update.json +++ b/bin/update.json @@ -2,7 +2,7 @@ "addons": { "unlisted-particle@particlecore.github.io": { "updates": [{ - "version": "1.7.4", + "version": "1.7.5", "update_link": "https://github.com/ParticleCore/Particle/raw/master/dist/YouTubePlus.xpi", "applications": { "gecko": { diff --git a/dist/YouTubePlus.xpi b/dist/YouTubePlus.xpi index df2fbdf..492d8e7 100644 Binary files a/dist/YouTubePlus.xpi and b/dist/YouTubePlus.xpi differ diff --git a/src/Userscript/YouTubePlus.user.js b/src/Userscript/YouTubePlus.user.js index da6d3cd..09bbf94 100644 --- a/src/Userscript/YouTubePlus.user.js +++ b/src/Userscript/YouTubePlus.user.js @@ -1,5 +1,5 @@ // ==UserScript== -// @version 1.7.4 +// @version 1.7.5 // @name YouTube + // @namespace https://github.com/ParticleCore // @description YouTube with more freedom @@ -19,10 +19,10 @@ // ==/UserScript== (function () { "use strict"; - let particle = { + var particle = { inject: function(is_userscript) { function setLocale(content) { - let i, j, list, temp, ytplabel; + var i, j, list, temp, ytplabel; ytplabel = content.querySelectorAll("[data-p]"); i = ytplabel.length; while (i--) { @@ -120,7 +120,7 @@ return next[Object.keys(next)[0]].localeCompare(previous[Object.keys(previous)[0]]); } function getBlacklist(blist) { - let i, obj, temp, lnk, keys, list, fragment, sortAlpha; + var i, obj, temp, lnk, keys, list, fragment, sortAlpha; list = user_settings.blacklist; fragment = document.createDocumentFragment(); sortAlpha = []; @@ -155,7 +155,7 @@ blist.appendChild(fragment); } function getValues(menu) { - let i, ytp, list; + var i, ytp, list; if (user_settings) { list = menu.querySelector("#blacklist"); if (list) { @@ -182,7 +182,7 @@ return menu; } function getMenu(section) { - let i, temp, svg, inputs; + var i, temp, svg, inputs; temp = document.createElement("template"); if (section === "MEN") { temp.innerHTML = // @@ -379,7 +379,7 @@ return setLocale(getValues(temp.content)); } function exportSettings(target) { - let expCont; + var expCont; if (target.classList.contains("P-impexp") || target.classList.contains("P-implang")) { expCont = document.getElementById("exp-cont"); if (expCont) { @@ -422,7 +422,7 @@ } } function delBlackList(event) { - let newKey = user_settings.blacklist; + var newKey = user_settings.blacklist; delete newKey[event.target.nextSibling.href.split("/channel/")[1]]; event.target.parentNode.outerHTML = ""; set("blacklist", newKey); @@ -431,7 +431,7 @@ document.body.classList.remove("show-guide-button-notification"); } function saveSettings(salt) { - let i, value, notification, navId, userSets, savedSets; + var i, value, notification, navId, userSets, savedSets; navId = document.querySelector(".selected").id; userSets = document.getElementById("P-content").querySelectorAll("[id^='" + navId + "']"); savedSets = user_settings; @@ -495,7 +495,7 @@ } } function settingsTemplate(event) { - let pWrapper; + var pWrapper; if (event.target.id === "P" && event.target.tagName !== "INPUT") { pWrapper = document.getElementById("P-settings"); if (pWrapper) { @@ -522,7 +522,7 @@ } } function settingsMenu() { - let notif_button, settings_button, welcome_message; + var notif_button, settings_button, welcome_message; if (settingsMenu.settingsButton) { return; } @@ -564,7 +564,7 @@ } function modComment(original) { return function (a) { - let comments, is_live; + var comments, is_live; comments = document.getElementById("watch-discussion"); is_live = window.ytplayer && window.ytplayer.config && window.ytplayer.config.args && window.ytplayer.config.args.livestream; if (a.split("comments").length > 1 && !is_live && comments && !comments.lazyload && user_settings.VID_HIDE_COMS === "1" && !comments.classList.contains("show")) { @@ -589,7 +589,7 @@ } function modEmbed(original) { return function (a, b) { - let temp, player; + var temp, player; temp = a.id || a; if (temp !== "player-api" && temp !== "upsell-video") { return original.apply(this, arguments); @@ -612,7 +612,7 @@ } function modAutoplayFullscreen(original) { return function () { - let has_ended, next_button, next_clicked; + var has_ended, next_button, next_clicked; has_ended = api && api.getCurrentTime && Math.round(api.getCurrentTime()) >= Math.floor(api.getDuration()); next_clicked = document.activeElement.classList.contains("ytp-button-next") || document.activeElement.classList.contains("ytp-next-button"); if (!user_settings.plApl && !next_clicked && has_ended) { @@ -634,7 +634,7 @@ } function modPlayerCreate(original) { return function (a, b) { - let i, temp, player; + var i, temp, player; temp = a.id || a; if (temp !== "player-api" && temp !== "upsell-video") { return original.apply(this, arguments); @@ -675,7 +675,7 @@ return ModArgsWatch.Original.apply(this, arguments); } function scriptExit(event) { - let i, j, key, temp; + var i, j, key, temp; if (event && event.target) { if (event.target.getAttribute("name") === "www/base") { window.yt.setConfig = modSetConfig(window.yt.setConfig); @@ -741,7 +741,7 @@ } } function checkBounds(elm, X, Y) { - let snapX, snapY; + var snapX, snapY; if (X > -1 && X + elm.offsetWidth < document.documentElement.offsetWidth) { snapX = false; } else if (X < 1) { @@ -763,7 +763,7 @@ return {X: X + "px", Y: Y + "px", snapX: snapX, snapY: snapY}; } function updatePos() { - let x, y, height, player, bounds; + var x, y, height, player, bounds; player = document.getElementById("movie_player"); if (!document.documentElement.classList.contains("floater") || window.innerWidth < 657) { if (player) { @@ -797,7 +797,7 @@ document[(window.chrome && "body") || "documentElement"].scrollTop = 0; } function dragFloater(event) { - let excluded, isFScreen, isFloater, bounds, player; + var excluded, isFScreen, isFloater, bounds, player; isFScreen = document.querySelector(".ytp-fullscreen"); isFloater = document.documentElement.classList.contains("floater"); if (event && !isFScreen && isFloater) { @@ -848,7 +848,7 @@ } } function iniFloater() { - let player, plrApi, out_of_sight, isFloater, isFScreen, floaterUI, settings_open; + var player, plrApi, out_of_sight, isFloater, isFScreen, floaterUI, settings_open; player = document.getElementById("movie_player"); plrApi = document.getElementById("player-api").getBoundingClientRect(); settings_open = document.getElementById("P-settings"); @@ -892,7 +892,7 @@ } } function alwaysActive(event) { - let i, list, clear, length, eventClone; + var i, list, clear, length, eventClone; clear = window.location.pathname == "/watch" && api && api !== event.target && !api.contains(event.target) && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey && !event.target.isContentEditable; if ( clear && ( @@ -947,7 +947,7 @@ } } function getThumb() { - let args, base, thumb_url; + var args, base, thumb_url; args = window.ytplayer.config.args; base = (args.iurl_webp && "_webp") || ""; thumb_url = args["iurlmaxres" + base] || args["iurlsd" + base] || args["iurl" + base]; @@ -960,7 +960,7 @@ } } function getScreenshot() { - let width, height, aspectRatio, video, container, canvas, close, context; + var width, height, aspectRatio, video, container, canvas, close, context; video = document.querySelector("video"); container = document.getElementById("screenshot-result") || document.createElement("div"); canvas = container.querySelector("canvas") || document.createElement("canvas"); @@ -1001,7 +1001,7 @@ } } function toggleFullBrowser(event) { - let plrState = api && api.getPlayerState && api.getPlayerState(); + var plrState = api && api.getPlayerState && api.getPlayerState(); plrState = plrState < 5 && plrState > 0; document[(window.chrome && "body") || "documentElement"].scrollTop = 0; document.addEventListener("keydown", exitFullBrowser); @@ -1014,7 +1014,7 @@ } } function toggleFrames(event) { - let i, pi, fps, temp; + var i, pi, fps, temp; advancedOptions.frame_step = document.getElementById("framestep-button"); if (event && ["EMBED", "INPUT", "OBJECT", "TEXTAREA"].indexOf(document.activeElement.tagName) < 0 && event.target.tagName !== "IFRAME" && !event.target.getAttribute("contenteditable")) { if ((event.keyCode === 37 || event.keyCode === 39) && event.shiftKey) { @@ -1068,7 +1068,7 @@ document.getElementById("autoplay-button").classList[(user_settings.VID_PLR_ATPL && "add") || "remove"]("active"); } function toggleLoop(event) { - let videoPlayer = document.querySelector("video"); + var videoPlayer = document.querySelector("video"); if (videoPlayer) { videoPlayer.loop = event ? !user_settings.loopVid : user_settings.loopVid; if (event) { @@ -1078,7 +1078,7 @@ set("loopVid", advancedOptions.loop_button.classList.contains("active")); } function toggleCinemaMode(event) { - let plrState = api && api.getPlayerState && api.getPlayerState() < 5 && api.getPlayerState() > 0; + var plrState = api && api.getPlayerState && api.getPlayerState() < 5 && api.getPlayerState() > 0; set("lightsOut", event ? !user_settings.lightsOut : true); advancedOptions.cinema_mode.classList[(user_settings.lightsOut && "add") || "remove"]("active"); if (event && plrState) { @@ -1126,7 +1126,7 @@ } } function advancedOptions() { - let header, cnslBtn, cnslCont; + var header, cnslBtn, cnslCont; header = document.getElementById("watch-header"); cnslBtn = document.getElementById("console-button"); advancedOptions.controls = document.getElementById("player-console"); @@ -1179,7 +1179,7 @@ } } function iniAction(event) { - let observer, load_more, click_title; + var observer, load_more, click_title; load_more = document.querySelector("#watch-more-related, .load-more-button"); click_title = document.querySelector(".yt-uix-tile"); while (click_title) { @@ -1208,7 +1208,7 @@ } } function setButtons() { - let i, j, list, temp, thumb, button; + var i, j, list, temp, thumb, button; list = Object.keys(modThumbs.thumbs); i = list.length; while (i--) { @@ -1246,7 +1246,7 @@ } } function delVideos() { - let i, j, temp, parent, blacklist, has_upnext; + var i, j, temp, parent, blacklist, has_upnext; has_upnext = document.querySelector(".autoplay-bar"); blacklist = Object.keys(user_settings.blacklist); i = blacklist.length; @@ -1299,7 +1299,7 @@ } } function getVideos() { - let i, list, temp, channel_id; + var i, list, temp, channel_id; modThumbs.thumbs = {}; list = document.querySelectorAll(` .yt-lockup-byline > a, @@ -1337,7 +1337,7 @@ } } function setVideoCount() { - let span = document.createElement("span"); + var span = document.createElement("span"); span.textContent = " · "; enhancedDetails.username.appendChild(span); enhancedDetails.link.href = window.location.origin + "/channel/" + enhancedDetails.user.dataset.ytid + "/videos"; @@ -1367,7 +1367,7 @@ } } function getChannelInfo(details) { - let retry, isLive; + var retry, isLive; isLive = details.target.response.querySelector(".yt-badge-live"); if (!isLive) { retry = details.target.responseURL.split("/videos").length < 2; @@ -1397,7 +1397,7 @@ } } function reverseControl() { - let i, temp, prev, next, list, videos; + var i, temp, prev, next, list, videos; prev = document.querySelector(".prev-playlist-list-item"); next = document.querySelector(".next-playlist-list-item"); list = document.getElementById("playlist-autoscroll-list"); @@ -1428,7 +1428,7 @@ } } function createButton(type, label, bool, call) { - let button = document.createElement("template"); + var button = document.createElement("template"); button.innerHTML = // `