Skip to content

Commit bd0c968

Browse files
authored
Bump 1.2.2
1 parent b8b2704 commit bd0c968

File tree

11 files changed

+80
-17
lines changed

11 files changed

+80
-17
lines changed

Crunchyroll_Premium/blockevidon.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
window.evidon_dg = {}
2+
3+
Object.defineProperty(window.evidon_dg, "evidonCriticalDomains", {
4+
get: function () { return ['wvc-x-callback:']; },
5+
});
6+
Object.defineProperty(window.evidon_dg, "productNames", {
7+
get: function () { return {}; },
8+
});
9+
Object.defineProperty(window.evidon_dg, "loadedProducts", {
10+
get: function () { return []; },
11+
});
12+
Object.defineProperty(window.evidon_dg, "productIds", {
13+
get: function () { return []; },
14+
});

Crunchyroll_Premium/content.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,16 @@ function importBetaPlayer(ready = false) {
7777
setTimeout(() => importBetaPlayer(!!videoPlayer), 100);
7878
return;
7979
}
80+
var lastWatchedPlayer = query('#frame');
81+
if (query('.video-player') && lastWatchedPlayer)
82+
lastWatchedPlayer.parentNode.removeChild(lastWatchedPlayer);
8083

8184
console.log("[CR Beta] Removendo player da Crunchyroll...");
82-
remove('.video-player-placeholder', 'Video Placeholder')
85+
remove('.video-player-placeholder', 'Video Placeholder');
86+
remove('.video-player', 'Video Player', true);
87+
remove('.blocked-stream-overlay', 'Blocked Overlay', true);
88+
videoPlayer.src = '';
8389
const appendTo = videoPlayer.parentNode;
84-
appendTo.removeChild(videoPlayer);
8590

8691
console.log("[CR Beta] Pegando dados da stream...");
8792
var external_lang = preservedState.localization.locale.toLowerCase()
@@ -94,12 +99,14 @@ function importBetaPlayer(ready = false) {
9499
var old_url = `https://www.crunchyroll.com/${external_lang}/${series_slug}/episode-${external_id}`
95100
var up_next = document.querySelector('[data-t="next-episode"] > a')
96101
var playback = ep.playback
102+
var series = document.querySelector('.show-title-link > h4')?.innerText;
97103

98104
var message = {
99105
'playback': playback,
100106
'old_url': old_url,
101107
'lang': ep_lang,
102108
'up_next': up_next ? up_next.href : undefined,
109+
'series': series ? series : undefined,
103110
}
104111

105112
console.log("[CR Beta] Adicionando o jwplayer...");
@@ -127,7 +134,7 @@ function addPlayer(element, playerInfo, beta = false) {
127134
playerInfo['up_next_cooldown'] = items.cooldown === undefined ? 5 : items.cooldown;
128135
playerInfo['up_next_enable'] = items.aseguir === undefined ? true : items.aseguir;
129136
playerInfo['force_mp4'] = items.forcemp4 === undefined ? false : items.forcemp4;
130-
playerInfo['version'] = '1.2.1';
137+
playerInfo['version'] = '1.2.2';
131138
playerInfo['noproxy'] = true;
132139
playerInfo['beta'] = beta;
133140
ifrm.contentWindow.postMessage(playerInfo, "*");
@@ -156,6 +163,7 @@ function registerChangeEpisode() {
156163
if (currentURL !== window.location.href) {
157164
currentURL = window.location.href
158165
if (currentURL.includes("/watch/")) {
166+
remove(".erc-watch-premium-upsell", "New Premium Sidebar", true)
159167
const HTML = await fetch(currentURL)
160168
console.log("[CR Beta] Searching for new INITIAL_STATE")
161169
preservedState = JSON.parse(pegaString(HTML, "__INITIAL_STATE__ = ", ";"))
@@ -196,3 +204,8 @@ function fetch(url) {
196204
xhr.send();
197205
})
198206
}
207+
208+
var s = document.createElement('script');
209+
s.src = chrome.runtime.getURL('blockevidon.js');
210+
s.onload = function () { this.remove(); };
211+
(document.head || document.documentElement).appendChild(s);

Crunchyroll_Premium/manifest.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Crunchyroll iFrame Player",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Permite ver todos os vídeos do crunchyroll gratuitamente.",
55
"author": "itallolegal",
66
"icons": {
@@ -16,6 +16,10 @@
1616
"declarativeNetRequest",
1717
"declarativeNetRequestFeedback"
1818
],
19+
"web_accessible_resources": [{
20+
"resources": ["blockevidon.js"],
21+
"matches": ["<all_urls>"]
22+
}],
1923
"host_permissions": [
2024
"https://pl.crunchyroll.com/*",
2125
"https://www.crunchyroll.com/*",

Crunchyroll_Premium/popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const globalDefault = { 'webvideocaster': false, 'cooldown': false, 'aseguir': true, 'forcemp4': 5 }
1+
const globalDefault = { 'webvideocaster': false, 'cooldown': 5, 'aseguir': true, 'forcemp4': false }
22
const globalVariables = Object.keys(globalDefault)
33

44
chrome.storage.sync.get(globalVariables, function (items) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
window.evidon_dg = {}
2+
3+
Object.defineProperty(window.evidon_dg, "evidonCriticalDomains", {
4+
get: function () { return ['wvc-x-callback:']; },
5+
});
6+
Object.defineProperty(window.evidon_dg, "productNames", {
7+
get: function () { return {}; },
8+
});
9+
Object.defineProperty(window.evidon_dg, "loadedProducts", {
10+
get: function () { return []; },
11+
});
12+
Object.defineProperty(window.evidon_dg, "productIds", {
13+
get: function () { return []; },
14+
});

Crunchyroll_Premium_Kiwi-Browser/content.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,16 @@ function importBetaPlayer(ready = false) {
136136
setTimeout(() => importBetaPlayer(!!videoPlayer), 100);
137137
return;
138138
}
139+
var lastWatchedPlayer = query('#frame');
140+
if (query('.video-player') && lastWatchedPlayer)
141+
lastWatchedPlayer.parentNode.removeChild(lastWatchedPlayer);
139142

140143
console.log("[CR Beta] Removendo player da Crunchyroll...");
141-
remove('.video-player-placeholder', 'Video Placeholder')
144+
remove('.video-player-placeholder', 'Video Placeholder');
145+
remove('.video-player', 'Video Player', true);
146+
remove('.blocked-stream-overlay', 'Blocked Overlay', true);
147+
videoPlayer.src = '';
142148
const appendTo = videoPlayer.parentNode;
143-
appendTo.removeChild(videoPlayer);
144149

145150
console.log("[CR Beta] Pegando dados da stream...");
146151
var external_lang = preservedState.localization.locale.toLowerCase()
@@ -153,12 +158,14 @@ function importBetaPlayer(ready = false) {
153158
var old_url = `https://www.crunchyroll.com/${external_lang}/${series_slug}/episode-${external_id}`
154159
var up_next = document.querySelector('[data-t="next-episode"] > a')
155160
var playback = ep.playback
161+
var series = document.querySelector('.show-title-link > h4')?.innerText;
156162

157163
var message = {
158164
'playback': playback,
159165
'old_url': old_url,
160166
'lang': ep_lang,
161167
'up_next': up_next ? up_next.href : undefined,
168+
'series': series ? series : undefined,
162169
}
163170

164171
console.log("[CR Beta] Adicionando o jwplayer...");
@@ -186,7 +193,7 @@ function addPlayer(element, playerInfo, beta = false) {
186193
playerInfo['up_next_cooldown'] = items.cooldown === undefined ? 5 : items.cooldown;
187194
playerInfo['up_next_enable'] = items.aseguir === undefined ? true : items.aseguir;
188195
playerInfo['force_mp4'] = items.forcemp4 === undefined ? false : items.forcemp4;
189-
playerInfo['version'] = '1.2.1';
196+
playerInfo['version'] = '1.2.2';
190197
playerInfo['noproxy'] = true;
191198
playerInfo['beta'] = beta;
192199
ifrm.contentWindow.postMessage(playerInfo, "*");
@@ -233,6 +240,7 @@ function registerChangeEpisode() {
233240
if (currentURL !== window.location.href) {
234241
currentURL = window.location.href
235242
if (currentURL.includes("/watch/")) {
243+
remove(".erc-watch-premium-upsell", "New Premium Sidebar", true)
236244
const HTML = await fetch(currentURL)
237245
console.log("[CR Beta] Searching for new INITIAL_STATE")
238246
preservedState = JSON.parse(pegaString(HTML, "__INITIAL_STATE__ = ", ";"))
@@ -273,3 +281,8 @@ function fetch(url) {
273281
xhr.send();
274282
})
275283
}
284+
285+
var s = document.createElement('script');
286+
s.src = chrome.runtime.getURL('blockevidon.js');
287+
s.onload = function () { this.remove(); };
288+
(document.head || document.documentElement).appendChild(s);

Crunchyroll_Premium_Kiwi-Browser/manifest.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Crunchyroll iFrame Player",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Permite ver todos os vídeos do crunchyroll gratuitamente.",
55
"author": "itallolegal",
66
"icons": {
@@ -16,6 +16,10 @@
1616
"declarativeNetRequest",
1717
"declarativeNetRequestFeedback"
1818
],
19+
"web_accessible_resources": [{
20+
"resources": ["blockevidon.js"],
21+
"matches": ["<all_urls>"]
22+
}],
1923
"host_permissions": [
2024
"https://pl.crunchyroll.com/*",
2125
"https://www.crunchyroll.com/*",

Crunchyroll_Premium_Kiwi-Browser/popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const globalDefault = { 'webvideocaster': false, 'cooldown': false, 'aseguir': true, 'forcemp4': 5 }
1+
const globalDefault = { 'webvideocaster': false, 'cooldown': 5, 'aseguir': true, 'forcemp4': false }
22
const globalVariables = Object.keys(globalDefault)
33

44
chrome.storage.sync.get(globalVariables, function (items) {

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Obrigado por utilizar. :)
1010
Você pode encontrar as últimas versões disponíveis abaixo:
1111

1212

13-
<a href="https://github.com/mateus7g/crp-iframe-player/releases/latest" target="_blank"><img align="right" alt="Desktop" src="https://img.shields.io/badge/desktop-v1.2.1-violet?style=for-the-badge&logo=windows"></a>
13+
<a href="https://github.com/mateus7g/crp-iframe-player/releases/latest" target="_blank"><img align="right" alt="Desktop" src="https://img.shields.io/badge/desktop-v1.2.2-violet?style=for-the-badge&logo=windows"></a>
1414

1515
#### Desktop (PC)
1616

1717
Atualmente a versão para Desktop está disponível [aqui](https://github.com/Mateus7G/crp-iframe-player/releases/latest).
1818
Para instalar veja o passo a passo [para pc](#%EF%B8%8F-como-instalar-desktop).
1919

20-
<a href="https://github.com/Mateus7G/crp-iframe-player/releases/latest" target="_blank"><img align="right" alt="Android" src="https://img.shields.io/badge/android-v1.2.1-violet?style=for-the-badge&logo=android"></a>
20+
<a href="https://github.com/Mateus7G/crp-iframe-player/releases/latest" target="_blank"><img align="right" alt="Android" src="https://img.shields.io/badge/android-v1.2.2-violet?style=for-the-badge&logo=android"></a>
2121

2222
#### Android (Kiwi)
2323

assets/js/player.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ window.addEventListener("message", async e => {
205205
playerInstance.addButton(...webvideocasterBtn);
206206
else
207207
playerInstance.addButton(...downloadBtn);
208-
if (!tampermonkey && version !== "1.2.1")
208+
if (!tampermonkey && version !== "1.2.2")
209209
playerInstance.addButton(...updateBtn);
210210

211211
// Definir URL e Tamanho na lista de download

0 commit comments

Comments
 (0)