From bd0c96821283996bacb0c5b9124b86577f0f6f5b Mon Sep 17 00:00:00 2001 From: _Mateus7G Date: Sat, 30 Jul 2022 16:24:59 -0300 Subject: [PATCH] Bump 1.2.2 --- Crunchyroll_Premium/blockevidon.js | 14 ++++++++++++++ Crunchyroll_Premium/content.js | 19 ++++++++++++++++--- Crunchyroll_Premium/manifest.json | 6 +++++- Crunchyroll_Premium/popup.js | 2 +- .../blockevidon.js | 14 ++++++++++++++ Crunchyroll_Premium_Kiwi-Browser/content.js | 19 ++++++++++++++++--- .../manifest.json | 6 +++++- Crunchyroll_Premium_Kiwi-Browser/popup.js | 2 +- README.md | 4 ++-- assets/js/player.js | 2 +- index.html | 9 +++++---- 11 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 Crunchyroll_Premium/blockevidon.js create mode 100644 Crunchyroll_Premium_Kiwi-Browser/blockevidon.js diff --git a/Crunchyroll_Premium/blockevidon.js b/Crunchyroll_Premium/blockevidon.js new file mode 100644 index 0000000..6fc089f --- /dev/null +++ b/Crunchyroll_Premium/blockevidon.js @@ -0,0 +1,14 @@ +window.evidon_dg = {} + +Object.defineProperty(window.evidon_dg, "evidonCriticalDomains", { + get: function () { return ['wvc-x-callback:']; }, +}); +Object.defineProperty(window.evidon_dg, "productNames", { + get: function () { return {}; }, +}); +Object.defineProperty(window.evidon_dg, "loadedProducts", { + get: function () { return []; }, +}); +Object.defineProperty(window.evidon_dg, "productIds", { + get: function () { return []; }, +}); diff --git a/Crunchyroll_Premium/content.js b/Crunchyroll_Premium/content.js index 2785087..652d88c 100644 --- a/Crunchyroll_Premium/content.js +++ b/Crunchyroll_Premium/content.js @@ -77,11 +77,16 @@ function importBetaPlayer(ready = false) { setTimeout(() => importBetaPlayer(!!videoPlayer), 100); return; } + var lastWatchedPlayer = query('#frame'); + if (query('.video-player') && lastWatchedPlayer) + lastWatchedPlayer.parentNode.removeChild(lastWatchedPlayer); console.log("[CR Beta] Removendo player da Crunchyroll..."); - remove('.video-player-placeholder', 'Video Placeholder') + remove('.video-player-placeholder', 'Video Placeholder'); + remove('.video-player', 'Video Player', true); + remove('.blocked-stream-overlay', 'Blocked Overlay', true); + videoPlayer.src = ''; const appendTo = videoPlayer.parentNode; - appendTo.removeChild(videoPlayer); console.log("[CR Beta] Pegando dados da stream..."); var external_lang = preservedState.localization.locale.toLowerCase() @@ -94,12 +99,14 @@ function importBetaPlayer(ready = false) { var old_url = `https://www.crunchyroll.com/${external_lang}/${series_slug}/episode-${external_id}` var up_next = document.querySelector('[data-t="next-episode"] > a') var playback = ep.playback + var series = document.querySelector('.show-title-link > h4')?.innerText; var message = { 'playback': playback, 'old_url': old_url, 'lang': ep_lang, 'up_next': up_next ? up_next.href : undefined, + 'series': series ? series : undefined, } console.log("[CR Beta] Adicionando o jwplayer..."); @@ -127,7 +134,7 @@ function addPlayer(element, playerInfo, beta = false) { playerInfo['up_next_cooldown'] = items.cooldown === undefined ? 5 : items.cooldown; playerInfo['up_next_enable'] = items.aseguir === undefined ? true : items.aseguir; playerInfo['force_mp4'] = items.forcemp4 === undefined ? false : items.forcemp4; - playerInfo['version'] = '1.2.1'; + playerInfo['version'] = '1.2.2'; playerInfo['noproxy'] = true; playerInfo['beta'] = beta; ifrm.contentWindow.postMessage(playerInfo, "*"); @@ -156,6 +163,7 @@ function registerChangeEpisode() { if (currentURL !== window.location.href) { currentURL = window.location.href if (currentURL.includes("/watch/")) { + remove(".erc-watch-premium-upsell", "New Premium Sidebar", true) const HTML = await fetch(currentURL) console.log("[CR Beta] Searching for new INITIAL_STATE") preservedState = JSON.parse(pegaString(HTML, "__INITIAL_STATE__ = ", ";")) @@ -196,3 +204,8 @@ function fetch(url) { xhr.send(); }) } + +var s = document.createElement('script'); +s.src = chrome.runtime.getURL('blockevidon.js'); +s.onload = function () { this.remove(); }; +(document.head || document.documentElement).appendChild(s); diff --git a/Crunchyroll_Premium/manifest.json b/Crunchyroll_Premium/manifest.json index e680778..53ae573 100644 --- a/Crunchyroll_Premium/manifest.json +++ b/Crunchyroll_Premium/manifest.json @@ -1,6 +1,6 @@ { "name": "Crunchyroll iFrame Player", - "version": "1.2.1", + "version": "1.2.2", "description": "Permite ver todos os vídeos do crunchyroll gratuitamente.", "author": "itallolegal", "icons": { @@ -16,6 +16,10 @@ "declarativeNetRequest", "declarativeNetRequestFeedback" ], + "web_accessible_resources": [{ + "resources": ["blockevidon.js"], + "matches": [""] + }], "host_permissions": [ "https://pl.crunchyroll.com/*", "https://www.crunchyroll.com/*", diff --git a/Crunchyroll_Premium/popup.js b/Crunchyroll_Premium/popup.js index e32b61b..55e41ae 100644 --- a/Crunchyroll_Premium/popup.js +++ b/Crunchyroll_Premium/popup.js @@ -1,4 +1,4 @@ -const globalDefault = { 'webvideocaster': false, 'cooldown': false, 'aseguir': true, 'forcemp4': 5 } +const globalDefault = { 'webvideocaster': false, 'cooldown': 5, 'aseguir': true, 'forcemp4': false } const globalVariables = Object.keys(globalDefault) chrome.storage.sync.get(globalVariables, function (items) { diff --git a/Crunchyroll_Premium_Kiwi-Browser/blockevidon.js b/Crunchyroll_Premium_Kiwi-Browser/blockevidon.js new file mode 100644 index 0000000..6fc089f --- /dev/null +++ b/Crunchyroll_Premium_Kiwi-Browser/blockevidon.js @@ -0,0 +1,14 @@ +window.evidon_dg = {} + +Object.defineProperty(window.evidon_dg, "evidonCriticalDomains", { + get: function () { return ['wvc-x-callback:']; }, +}); +Object.defineProperty(window.evidon_dg, "productNames", { + get: function () { return {}; }, +}); +Object.defineProperty(window.evidon_dg, "loadedProducts", { + get: function () { return []; }, +}); +Object.defineProperty(window.evidon_dg, "productIds", { + get: function () { return []; }, +}); diff --git a/Crunchyroll_Premium_Kiwi-Browser/content.js b/Crunchyroll_Premium_Kiwi-Browser/content.js index 364b7f8..23bcb23 100644 --- a/Crunchyroll_Premium_Kiwi-Browser/content.js +++ b/Crunchyroll_Premium_Kiwi-Browser/content.js @@ -136,11 +136,16 @@ function importBetaPlayer(ready = false) { setTimeout(() => importBetaPlayer(!!videoPlayer), 100); return; } + var lastWatchedPlayer = query('#frame'); + if (query('.video-player') && lastWatchedPlayer) + lastWatchedPlayer.parentNode.removeChild(lastWatchedPlayer); console.log("[CR Beta] Removendo player da Crunchyroll..."); - remove('.video-player-placeholder', 'Video Placeholder') + remove('.video-player-placeholder', 'Video Placeholder'); + remove('.video-player', 'Video Player', true); + remove('.blocked-stream-overlay', 'Blocked Overlay', true); + videoPlayer.src = ''; const appendTo = videoPlayer.parentNode; - appendTo.removeChild(videoPlayer); console.log("[CR Beta] Pegando dados da stream..."); var external_lang = preservedState.localization.locale.toLowerCase() @@ -153,12 +158,14 @@ function importBetaPlayer(ready = false) { var old_url = `https://www.crunchyroll.com/${external_lang}/${series_slug}/episode-${external_id}` var up_next = document.querySelector('[data-t="next-episode"] > a') var playback = ep.playback + var series = document.querySelector('.show-title-link > h4')?.innerText; var message = { 'playback': playback, 'old_url': old_url, 'lang': ep_lang, 'up_next': up_next ? up_next.href : undefined, + 'series': series ? series : undefined, } console.log("[CR Beta] Adicionando o jwplayer..."); @@ -186,7 +193,7 @@ function addPlayer(element, playerInfo, beta = false) { playerInfo['up_next_cooldown'] = items.cooldown === undefined ? 5 : items.cooldown; playerInfo['up_next_enable'] = items.aseguir === undefined ? true : items.aseguir; playerInfo['force_mp4'] = items.forcemp4 === undefined ? false : items.forcemp4; - playerInfo['version'] = '1.2.1'; + playerInfo['version'] = '1.2.2'; playerInfo['noproxy'] = true; playerInfo['beta'] = beta; ifrm.contentWindow.postMessage(playerInfo, "*"); @@ -233,6 +240,7 @@ function registerChangeEpisode() { if (currentURL !== window.location.href) { currentURL = window.location.href if (currentURL.includes("/watch/")) { + remove(".erc-watch-premium-upsell", "New Premium Sidebar", true) const HTML = await fetch(currentURL) console.log("[CR Beta] Searching for new INITIAL_STATE") preservedState = JSON.parse(pegaString(HTML, "__INITIAL_STATE__ = ", ";")) @@ -273,3 +281,8 @@ function fetch(url) { xhr.send(); }) } + +var s = document.createElement('script'); +s.src = chrome.runtime.getURL('blockevidon.js'); +s.onload = function () { this.remove(); }; +(document.head || document.documentElement).appendChild(s); diff --git a/Crunchyroll_Premium_Kiwi-Browser/manifest.json b/Crunchyroll_Premium_Kiwi-Browser/manifest.json index 37ea8e8..49cd436 100644 --- a/Crunchyroll_Premium_Kiwi-Browser/manifest.json +++ b/Crunchyroll_Premium_Kiwi-Browser/manifest.json @@ -1,6 +1,6 @@ { "name": "Crunchyroll iFrame Player", - "version": "1.2.1", + "version": "1.2.2", "description": "Permite ver todos os vídeos do crunchyroll gratuitamente.", "author": "itallolegal", "icons": { @@ -16,6 +16,10 @@ "declarativeNetRequest", "declarativeNetRequestFeedback" ], + "web_accessible_resources": [{ + "resources": ["blockevidon.js"], + "matches": [""] + }], "host_permissions": [ "https://pl.crunchyroll.com/*", "https://www.crunchyroll.com/*", diff --git a/Crunchyroll_Premium_Kiwi-Browser/popup.js b/Crunchyroll_Premium_Kiwi-Browser/popup.js index e32b61b..55e41ae 100644 --- a/Crunchyroll_Premium_Kiwi-Browser/popup.js +++ b/Crunchyroll_Premium_Kiwi-Browser/popup.js @@ -1,4 +1,4 @@ -const globalDefault = { 'webvideocaster': false, 'cooldown': false, 'aseguir': true, 'forcemp4': 5 } +const globalDefault = { 'webvideocaster': false, 'cooldown': 5, 'aseguir': true, 'forcemp4': false } const globalVariables = Object.keys(globalDefault) chrome.storage.sync.get(globalVariables, function (items) { diff --git a/README.md b/README.md index a59aed4..d67a480 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ Obrigado por utilizar. :) Você pode encontrar as últimas versões disponíveis abaixo: -Desktop +Desktop #### Desktop (PC) Atualmente a versão para Desktop está disponível [aqui](https://github.com/Mateus7G/crp-iframe-player/releases/latest). Para instalar veja o passo a passo [para pc](#%EF%B8%8F-como-instalar-desktop). -Android +Android #### Android (Kiwi) diff --git a/assets/js/player.js b/assets/js/player.js index 2fa78e3..d1d5291 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -205,7 +205,7 @@ window.addEventListener("message", async e => { playerInstance.addButton(...webvideocasterBtn); else playerInstance.addButton(...downloadBtn); - if (!tampermonkey && version !== "1.2.1") + if (!tampermonkey && version !== "1.2.2") playerInstance.addButton(...updateBtn); // Definir URL e Tamanho na lista de download diff --git a/index.html b/index.html index 6ed2539..b4be8b8 100644 --- a/index.html +++ b/index.html @@ -71,22 +71,23 @@
Changelog - v1.2.1 + v1.2.2
Update available:
- Fix Crunchyroll Beta compatibility
- - Add WebVideoCaster button + - Fix WebVideoCaster button + - Fix popup default values
Download (pc) - +
Download (kiwi) - +