Skip to content

Commit 09c5008

Browse files
committed
V1.1 - new canal+ player
1 parent 792a60f commit 09c5008

File tree

6 files changed

+41
-31
lines changed

6 files changed

+41
-31
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CanalBlock
22
==========
33
Bloque les pubs du site canal+, et rend le chargement plus rapide
44

5-
LICENSE : Apache V2.
5+
LICENCE : Apache V2.
66

77
==========
88
INSTALLATION :

adBlock.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
var el = document.getElementById("CanalPlayerEmbarque")
2-
if(el) {
3-
el.setAttribute("embed","true");
4-
console.log("Pub bloquée !");
5-
}
1+
document.querySelector(".banner").innerHTML = '';

background.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
chrome.webRequest.onBeforeRequest.addListener(function (request) {
2-
if(request.url.indexOf("distributor") > -1) { //pub = on bloque
3-
return {cancel: true};
4-
} else if(request.url.indexOf("vp_player") > -1) { //ressources lentes = on redirige vers les locales
2+
if(request.url.indexOf("piximedia.fr") > -1 || request.url.indexOf("broadcast.pm") > -1) { //banniere pub = on bloque
3+
return {cancel: true};
4+
} else if(request.url.indexOf("static.canal-plus.net/pub/") > -1) { //vidéo pub = on redirige vers vidéo vide
55
return {
6-
redirectUrl: chrome.extension.getURL('ressources/as3_vp_player_2.4.15.23.1.swf')
6+
redirectUrl: chrome.extension.getURL('ressources/empty.mp4')
77
};
88
}
99

1010
}, {
11-
urls: ["http://fr-canalplus.videoplaza.tv/proxy/distributor/*",
12-
"http://fr-canalplus.videoplaza.tv/proxy/as3_vp_player" ]
11+
urls: ["*://static.canal-plus.net/pub/*", "*://broadcast.pm/*", "*://*.piximedia.fr/*" ]
1312
}, ["blocking"]);

manifest.json

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
11
{
2-
"background": {
3-
"scripts": [ "background.js" ],
4-
"persistent": true
5-
},
6-
"content_scripts": [ {
7-
"js": ["adBlock.js" ],
8-
"matches": [ "http://www.canalplus.fr/*" ]
9-
}],
10-
"description": "Supprimez les pubs canal",
11-
"icons": {
12-
"128": "icon128.png",
13-
"16": "icon16.png"
14-
},
15-
"web_accessible_resources": [
2+
"background": {
3+
"scripts": [
4+
"background.js"
5+
],
6+
"persistent": true
7+
},
8+
"content_scripts": [
9+
{
10+
"js": [
11+
"adBlock.js"
12+
],
13+
"matches": [
14+
"http://www.canalplus.fr/*"
15+
],
16+
"run_at": "document_end"
17+
}
18+
],
19+
"description": "Supprimez les pubs canal",
20+
"icons": {
21+
"128": "icon128.png",
22+
"16": "icon16.png"
23+
},
24+
"web_accessible_resources": [
1625
"ressources/*"
17-
],
18-
"manifest_version": 2,
19-
"name": "CanalBlock",
20-
"permissions": [ "http://www.canalplus.fr/*","http://fr-canalplus.videoplaza.tv/*","webRequest","webRequestBlocking" ],
21-
"version": "1.0"
26+
],
27+
"manifest_version": 2,
28+
"name": "CanalBlock",
29+
"permissions": [
30+
"*://static.canal-plus.net/pub/*",
31+
"*://broadcast.pm/*",
32+
"*://*.piximedia.fr/*",
33+
"webRequest",
34+
"webRequestBlocking"
35+
],
36+
"version": "1.1"
2237
}
-267 KB
Binary file not shown.

ressources/empty.mp4

4.13 KB
Binary file not shown.

0 commit comments

Comments
 (0)