diff --git a/bin/update.json b/bin/update.json index ca1f6ed..416cd07 100644 --- a/bin/update.json +++ b/bin/update.json @@ -2,7 +2,7 @@ "addons": { "unlisted-particle@particlecore.github.io": { "updates": [{ - "version": "1.7.6", + "version": "1.7.7", "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 436b9e4..5d1ee3c 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 48e1509..60e145a 100644 --- a/src/Userscript/YouTubePlus.user.js +++ b/src/Userscript/YouTubePlus.user.js @@ -1,5 +1,5 @@ // ==UserScript== -// @version 1.7.6 +// @version 1.7.7 // @name YouTube + // @namespace https://github.com/ParticleCore // @description YouTube with more freedom @@ -1556,9 +1556,9 @@ }; } else if ( event.type === "mousemove" && ( - window.hasMoved || - Math.abs(event.clientX - window.oldPos.orgX) > 10 || - Math.abs(event.clientY - window.oldPos.orgY) > 10) + window.hasMoved || + Math.abs(event.clientX - window.oldPos.orgX) > 10 || + Math.abs(event.clientY - window.oldPos.orgY) > 10) ) { window.moveBy(event.clientX - window.oldPos.X, event.clientY - window.oldPos.Y); window.hasMoved = true; @@ -1789,19 +1789,19 @@ if ( sidebar && sidebar.parentNode && ( - window.location.pathname === "/results" && - sidebar && - sidebar.querySelectorAll("*").length < 10) || ( - sidebar && ( - user_settings.GEN_HDE_RECM_SDBR && - window.location.href.split("/feed/subscriptions").length > 1 || - user_settings.GEN_HDE_SRCH_SDBR && - window.location.pathname === "/results" || - user_settings.GEN_HDE_CHN_SDBR && - window.location.href.split(/\/(channel|user|c)\//).length > 1 - ) + window.location.pathname === "/results" && + sidebar && + sidebar.querySelectorAll("*").length < 10) || ( + sidebar && ( + user_settings.GEN_HDE_RECM_SDBR && + window.location.href.split("/feed/subscriptions").length > 1 || + user_settings.GEN_HDE_SRCH_SDBR && + window.location.pathname === "/results" || + user_settings.GEN_HDE_CHN_SDBR && + window.location.href.split(/\/(channel|user|c)\//).length > 1 ) - ) { + ) + ) { sidebar.outerHTML = ""; } if (window.location.pathname === "/watch" && user_settings.VID_HIDE_COMS > 1 && comments) { @@ -1978,7 +1978,7 @@ if (window.ytpsetwide) { window.ytpsetwide("wide", (user_settings.theaterMode ? "1" : "0"), -1); } - if (playerElement && window.location.pathname === "/watch") { + if (pageElement && playerElement && window.location.pathname === "/watch") { pageElement.classList[user_settings.theaterMode ? "add" : "remove"]("watch-wide"); pageElement.className = pageElement.className.replace(user_settings.theaterMode ? "non-" : "watch-stage", user_settings.theaterMode ? "" : "watch-non-stage"); playerElement.className = user_settings.theaterMode ? playerElement.className.replace("small", "large") : playerElement.className.replace("large", "small").replace("medium", "small"); @@ -2098,24 +2098,6 @@ return true; } } - function closeMigrationInstructions(event) { - if (event && event.target && event.target.id === "close_migration_instructions") { - document.removeEventListener("click", closeMigrationInstructions); - event.target.parentNode.outerHTML = ""; - set("migration_instructions", true); - } - } - function migrationInstructions() { - var temp = document.createElement("template"); - temp.innerHTML = // - `
- YouTube Plus has been updated and is now a Webextension. Unfortunately this means that your previous settings need to be imported manually.
- Click here if you wish to import the previous settings or know more about this change.
- -
`; - document.documentElement.appendChild(temp.content.firstChild); - document.addEventListener("click", closeMigrationInstructions); - } var api, cid, language, user_settings, player_instance, default_settings; if (isMaterial()) { return; @@ -2298,9 +2280,6 @@ } else { document.addEventListener("afterscriptexecute", scriptExit); } - if (!is_userscript && !window.chrome && !user_settings.migration_instructions) { - migrationInstructions(); - } document.addEventListener("spfdone", main); document.addEventListener("spfrequest", request); document.addEventListener("readystatechange", main, true); @@ -2354,7 +2333,7 @@ holder = document.createElement("link"); holder.rel = "stylesheet"; holder.type = "text/css"; - holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.6"; + holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.7"; document.documentElement.appendChild(holder); } holder = document.createElement("script"); diff --git a/src/Webextension/JS/YouTubePlus.user.js b/src/Webextension/JS/YouTubePlus.user.js index 48e1509..60e145a 100644 --- a/src/Webextension/JS/YouTubePlus.user.js +++ b/src/Webextension/JS/YouTubePlus.user.js @@ -1,5 +1,5 @@ // ==UserScript== -// @version 1.7.6 +// @version 1.7.7 // @name YouTube + // @namespace https://github.com/ParticleCore // @description YouTube with more freedom @@ -1556,9 +1556,9 @@ }; } else if ( event.type === "mousemove" && ( - window.hasMoved || - Math.abs(event.clientX - window.oldPos.orgX) > 10 || - Math.abs(event.clientY - window.oldPos.orgY) > 10) + window.hasMoved || + Math.abs(event.clientX - window.oldPos.orgX) > 10 || + Math.abs(event.clientY - window.oldPos.orgY) > 10) ) { window.moveBy(event.clientX - window.oldPos.X, event.clientY - window.oldPos.Y); window.hasMoved = true; @@ -1789,19 +1789,19 @@ if ( sidebar && sidebar.parentNode && ( - window.location.pathname === "/results" && - sidebar && - sidebar.querySelectorAll("*").length < 10) || ( - sidebar && ( - user_settings.GEN_HDE_RECM_SDBR && - window.location.href.split("/feed/subscriptions").length > 1 || - user_settings.GEN_HDE_SRCH_SDBR && - window.location.pathname === "/results" || - user_settings.GEN_HDE_CHN_SDBR && - window.location.href.split(/\/(channel|user|c)\//).length > 1 - ) + window.location.pathname === "/results" && + sidebar && + sidebar.querySelectorAll("*").length < 10) || ( + sidebar && ( + user_settings.GEN_HDE_RECM_SDBR && + window.location.href.split("/feed/subscriptions").length > 1 || + user_settings.GEN_HDE_SRCH_SDBR && + window.location.pathname === "/results" || + user_settings.GEN_HDE_CHN_SDBR && + window.location.href.split(/\/(channel|user|c)\//).length > 1 ) - ) { + ) + ) { sidebar.outerHTML = ""; } if (window.location.pathname === "/watch" && user_settings.VID_HIDE_COMS > 1 && comments) { @@ -1978,7 +1978,7 @@ if (window.ytpsetwide) { window.ytpsetwide("wide", (user_settings.theaterMode ? "1" : "0"), -1); } - if (playerElement && window.location.pathname === "/watch") { + if (pageElement && playerElement && window.location.pathname === "/watch") { pageElement.classList[user_settings.theaterMode ? "add" : "remove"]("watch-wide"); pageElement.className = pageElement.className.replace(user_settings.theaterMode ? "non-" : "watch-stage", user_settings.theaterMode ? "" : "watch-non-stage"); playerElement.className = user_settings.theaterMode ? playerElement.className.replace("small", "large") : playerElement.className.replace("large", "small").replace("medium", "small"); @@ -2098,24 +2098,6 @@ return true; } } - function closeMigrationInstructions(event) { - if (event && event.target && event.target.id === "close_migration_instructions") { - document.removeEventListener("click", closeMigrationInstructions); - event.target.parentNode.outerHTML = ""; - set("migration_instructions", true); - } - } - function migrationInstructions() { - var temp = document.createElement("template"); - temp.innerHTML = // - `
- YouTube Plus has been updated and is now a Webextension. Unfortunately this means that your previous settings need to be imported manually.
- Click here if you wish to import the previous settings or know more about this change.
- -
`; - document.documentElement.appendChild(temp.content.firstChild); - document.addEventListener("click", closeMigrationInstructions); - } var api, cid, language, user_settings, player_instance, default_settings; if (isMaterial()) { return; @@ -2298,9 +2280,6 @@ } else { document.addEventListener("afterscriptexecute", scriptExit); } - if (!is_userscript && !window.chrome && !user_settings.migration_instructions) { - migrationInstructions(); - } document.addEventListener("spfdone", main); document.addEventListener("spfrequest", request); document.addEventListener("readystatechange", main, true); @@ -2354,7 +2333,7 @@ holder = document.createElement("link"); holder.rel = "stylesheet"; holder.type = "text/css"; - holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.6"; + holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.7"; document.documentElement.appendChild(holder); } holder = document.createElement("script"); diff --git a/src/Webextension/manifest.json b/src/Webextension/manifest.json index 6c5bc63..551a7eb 100644 --- a/src/Webextension/manifest.json +++ b/src/Webextension/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "YouTube Plus", - "version": "1.7.6", + "version": "1.7.7", "description": "YouTube with more freedom", "default_locale": "en", "icons": {