|
1 | 1 | // ==UserScript== |
2 | | -// @version 1.7.6 |
| 2 | +// @version 1.7.7 |
3 | 3 | // @name YouTube + |
4 | 4 | // @namespace https://github.com/ParticleCore |
5 | 5 | // @description YouTube with more freedom |
|
1556 | 1556 | }; |
1557 | 1557 | } else if ( |
1558 | 1558 | event.type === "mousemove" && ( |
1559 | | - window.hasMoved || |
1560 | | - Math.abs(event.clientX - window.oldPos.orgX) > 10 || |
1561 | | - Math.abs(event.clientY - window.oldPos.orgY) > 10) |
| 1559 | + window.hasMoved || |
| 1560 | + Math.abs(event.clientX - window.oldPos.orgX) > 10 || |
| 1561 | + Math.abs(event.clientY - window.oldPos.orgY) > 10) |
1562 | 1562 | ) { |
1563 | 1563 | window.moveBy(event.clientX - window.oldPos.X, event.clientY - window.oldPos.Y); |
1564 | 1564 | window.hasMoved = true; |
|
1789 | 1789 | if ( |
1790 | 1790 | sidebar && |
1791 | 1791 | sidebar.parentNode && ( |
1792 | | - window.location.pathname === "/results" && |
1793 | | - sidebar && |
1794 | | - sidebar.querySelectorAll("*").length < 10) || ( |
1795 | | - sidebar && ( |
1796 | | - user_settings.GEN_HDE_RECM_SDBR && |
1797 | | - window.location.href.split("/feed/subscriptions").length > 1 || |
1798 | | - user_settings.GEN_HDE_SRCH_SDBR && |
1799 | | - window.location.pathname === "/results" || |
1800 | | - user_settings.GEN_HDE_CHN_SDBR && |
1801 | | - window.location.href.split(/\/(channel|user|c)\//).length > 1 |
1802 | | - ) |
| 1792 | + window.location.pathname === "/results" && |
| 1793 | + sidebar && |
| 1794 | + sidebar.querySelectorAll("*").length < 10) || ( |
| 1795 | + sidebar && ( |
| 1796 | + user_settings.GEN_HDE_RECM_SDBR && |
| 1797 | + window.location.href.split("/feed/subscriptions").length > 1 || |
| 1798 | + user_settings.GEN_HDE_SRCH_SDBR && |
| 1799 | + window.location.pathname === "/results" || |
| 1800 | + user_settings.GEN_HDE_CHN_SDBR && |
| 1801 | + window.location.href.split(/\/(channel|user|c)\//).length > 1 |
1803 | 1802 | ) |
1804 | | - ) { |
| 1803 | + ) |
| 1804 | + ) { |
1805 | 1805 | sidebar.outerHTML = ""; |
1806 | 1806 | } |
1807 | 1807 | if (window.location.pathname === "/watch" && user_settings.VID_HIDE_COMS > 1 && comments) { |
|
1978 | 1978 | if (window.ytpsetwide) { |
1979 | 1979 | window.ytpsetwide("wide", (user_settings.theaterMode ? "1" : "0"), -1); |
1980 | 1980 | } |
1981 | | - if (playerElement && window.location.pathname === "/watch") { |
| 1981 | + if (pageElement && playerElement && window.location.pathname === "/watch") { |
1982 | 1982 | pageElement.classList[user_settings.theaterMode ? "add" : "remove"]("watch-wide"); |
1983 | 1983 | pageElement.className = pageElement.className.replace(user_settings.theaterMode ? "non-" : "watch-stage", user_settings.theaterMode ? "" : "watch-non-stage"); |
1984 | 1984 | playerElement.className = user_settings.theaterMode ? playerElement.className.replace("small", "large") : playerElement.className.replace("large", "small").replace("medium", "small"); |
|
2098 | 2098 | return true; |
2099 | 2099 | } |
2100 | 2100 | } |
2101 | | - function closeMigrationInstructions(event) { |
2102 | | - if (event && event.target && event.target.id === "close_migration_instructions") { |
2103 | | - document.removeEventListener("click", closeMigrationInstructions); |
2104 | | - event.target.parentNode.outerHTML = ""; |
2105 | | - set("migration_instructions", true); |
2106 | | - } |
2107 | | - } |
2108 | | - function migrationInstructions() { |
2109 | | - var temp = document.createElement("template"); |
2110 | | - temp.innerHTML = // |
2111 | | - `<div style='border-radius: 2px; color: #FFF; font: 12px Roboto,arial,sans-serif; padding: 10px; background-color: rgb(0, 153, 255); box-shadow: 0 0 3px rgba(0, 0, 0, 0.5); position: fixed; z-index: 99999; top: 50%; left: 50%; transform: translate(-50%, -50%);'> |
2112 | | - YouTube Plus has been updated and is now a Webextension. Unfortunately this means that your previous settings need to be imported manually.<br> |
2113 | | - <a href='https://github.com/ParticleCore/Particle/wiki/Restore-settings' target='_blank' style='color:#FFF;font-weight:bold;'>Click here</a> if you wish to import the previous settings or know more about this change.<br> |
2114 | | - <button id='close_migration_instructions' style='background-color: rgba(255, 255, 255, 0.3); color: #FFF; cursor: pointer; margin-top: 10px; border-radius: 2px; padding: 4px; float: right;'>CLOSE</button> |
2115 | | - </div>`; |
2116 | | - document.documentElement.appendChild(temp.content.firstChild); |
2117 | | - document.addEventListener("click", closeMigrationInstructions); |
2118 | | - } |
2119 | 2101 | var api, cid, language, user_settings, player_instance, default_settings; |
2120 | 2102 | if (isMaterial()) { |
2121 | 2103 | return; |
|
2298 | 2280 | } else { |
2299 | 2281 | document.addEventListener("afterscriptexecute", scriptExit); |
2300 | 2282 | } |
2301 | | - if (!is_userscript && !window.chrome && !user_settings.migration_instructions) { |
2302 | | - migrationInstructions(); |
2303 | | - } |
2304 | 2283 | document.addEventListener("spfdone", main); |
2305 | 2284 | document.addEventListener("spfrequest", request); |
2306 | 2285 | document.addEventListener("readystatechange", main, true); |
|
2354 | 2333 | holder = document.createElement("link"); |
2355 | 2334 | holder.rel = "stylesheet"; |
2356 | 2335 | holder.type = "text/css"; |
2357 | | - holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.6"; |
| 2336 | + holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.7"; |
2358 | 2337 | document.documentElement.appendChild(holder); |
2359 | 2338 | } |
2360 | 2339 | holder = document.createElement("script"); |
|
0 commit comments