Skip to content

Commit

Permalink
#18 added support for more sites
Browse files Browse the repository at this point in the history
.tv may not work
  • Loading branch information
zekrom-vale committed Jun 28, 2017
1 parent e5228f9 commit 39d581f
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"http://www.viewster.com/serie/*",
"*://*.tv/*",
"https://www.vevo.com/watch/*",
"http://www.veoh.com//*",
"http://www.veoh.com/*",
"<all_urls>",
"file://*/*"
],
Expand Down
104 changes: 96 additions & 8 deletions Extension/popup/option.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,108 @@ <h1>
<span class="name"> Twitch</span>
</span>
<!--if[Pro]-->
<span class="box" title="Enable also at chrome://extensions">
<label class="switch">
<input type="checkbox" id="file">
<div class="slider round"></div>
</label>
<span class="name"> <a href="chrome://extensions" target="_blank" style="color:black">File</a></span>
</span>
<div id="more" style="display:none">
<script src="optionFile.js"></script>
<span class="box">
<label class="switch">
<input type="checkbox" id="Dailymotion"/>
<div class="slider round"></div>
</label>
<span class="name"> Dailymotion</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="hulu"/>
<div class="slider round"></div>
</label>
<span class="name"> hulu</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Vimeo"/>
<div class="slider round"></div>
</label>
<span class="name"> Vimeo</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Liveleak"/>
<div class="slider round"></div>
</label>
<span class="name"> Liveleak</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Break"/>
<div class="slider round"></div>
</label>
<span class="name"> Break</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Netflix"/>
<div class="slider round"></div>
</label>
<span class="name"> Netflix</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Vine"/>
<div class="slider round"></div>
</label>
<span class="name"> Vine</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Yahoo2"/>
<div class="slider round"></div>
</label>
<span class="name"> Yahoo</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Viewster"/>
<div class="slider round"></div>
</label>
<span class="name"> Viewster</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Dot_tv"/>
<div class="slider round"></div>
</label>
<span class="name"> Dot tv</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Vevo"/>
<div class="slider round"></div>
</label>
<span class="name"> Vevo</span>
</span>
<span class="box">
<label class="switch">
<input type="checkbox" id="Veoh"/>
<div class="slider round"></div>
</label>
<span class="name"> Veoh</span>
</span>
</div>
<span class="box">
<label class="switch">
<input type="checkbox" id="All"/>
<div class="slider round red"></div>
</label>
<span class="name" style="color:red"> All URLs</span>
</span>
<span class="box" title="Enable also at chrome://extensions">
<label class="switch">
<input type="checkbox" id="file">
<div class="slider round"></div>
</label>
<span class="name"> <a href="chrome://extensions" target="_blank" style="color:black">File</a></span>
</span>
<button style="margin:10px 10px; border-radius:10px; background:aqua; color:black; font-size:20px; padding:5px; margin:0" id="expandM">More</button>
<!--endif[Pro]-->
</div>
</div>
Expand Down Expand Up @@ -246,7 +334,7 @@ <h1>
</span>
<input type="reset" id="Nreset"/>
</form>
<br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
<h3>
<a href="https://www.w3schools.com/css" target="_blank" title="w3schools on CSS" style="color:#6FF">
CSS Style (Advanced)
Expand Down
91 changes: 91 additions & 0 deletions Extension/popup/optionFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
document.addEventListener('DOMContentLoaded', ()=>{
const DLMN= document.getElementById('Dailymotion'),
HLU= document.getElementById('hulu'),
VIM= document.getElementById('Vimeo'),
LIVE= document.getElementById('Liveleak'),
BRK= document.getElementById('Break'),
FLIX= document.getElementById('Netflix'),
VINE= document.getElementById('Vine'),
YAH= document.getElementById('Yahoo2'),
VIE= document.getElementById('Viewster'),
DTV= document.getElementById('Dot_tv'),
VEV= document.getElementById('Vevo'),
VEHO= document.getElementById('Veoh');
chrome.permissions.getAll(callback=>{
info= callback.origins.toString();
if(info.includes("dailymotion.com")) DLMN.checked= true;
if(info.includes("hulu.com")) HLU.checked= true;
if(info.includes("vimeo.com")) VIM.checked= true;
if(info.includes("liveleak.com")) LIVE.checked= true;
if(info.includes("break.com")) BRK.checked= true;
if(info.includes("netflix.com")) FLIX.checked= true;
if(info.includes("vine.co")) VINE.checked= true;
if(info.includes("view.yahoo.com")) YAH.checked= true;
if(info.includes("viewster.com")) VIE.checked= true;
if(info.includes("*.tv")) DTV.checked= true;
if(info.includes("vevo.com")) VEV.checked= true;
if(info.includes("veoh.com")) VEHO.checked= true;
});
//Expand
document.getElementById('expandM').addEventListener('click', ()=>{
if(document.getElementById('more').style.display==''){
document.getElementById('more').style.display= 'none';
document.getElementById('formCSS').style.marginBottom='';
document.getElementById('expandM').innerHTML='More';
}
else{
document.getElementById('more').style.display= '';
document.getElementById('formCSS').style.marginBottom='531px';
document.getElementById('expandM').innerHTML='Less';
}
});
//Listen
DLMN.addEventListener('change', ()=>{
var url=["http://www.dailymotion.com/video/*"];
DLMN.checked? reQuest(url, DLMN): dePre(url, DLMN);
});
HLU.addEventListener('change', ()=>{
var url=["https://www.hulu.com/*"];
HLU.checked? reQuest(url, HLU): dePre(url, HLU);
});
VIM.addEventListener('change', ()=>{
var url=["https://vimeo.com/*"];
VIM.checked? reQuest(url, VIM): dePre(url, VIM);
});
LIVE.addEventListener('change', ()=>{
var url=["https://www.liveleak.com/view*"];
LIVE.checked? reQuest(url, LIVE): dePre(url, LIVE);
});
BRK.addEventListener('change', ()=>{
var url=["http://www.break.com/video/*"];
BRK.checked? reQuest(url, BRK): dePre(url, BRK);
});
FLIX.addEventListener('change', ()=>{
var url=["https://www.netflix.com/"];
FLIX.checked? reQuest(url, FLIX): dePre(url, FLIX);
});
VINE.addEventListener('change', ()=>{
var url=["https://vine.co/*"];
VINE.checked? reQuest(url, VINE): dePre(url, VINE);
});
YAH.addEventListener('change', ()=>{
var url=["https://view.yahoo.com/show/*"];
YAH.checked? reQuest(url, YAH): dePre(url, YAH);
});
VIE.addEventListener('change', ()=>{
var url=["http://www.viewster.com/serie/*"];
VIE.checked? reQuest(url, VIE): dePre(url, VIE);
});
DTV.addEventListener('change', ()=>{
var url=["*://*.tv/*"];
DTV.checked? reQuest(url, DTV): dePre(url, DTV);
});
VEV.addEventListener('change', ()=>{
var url=["https://www.vevo.com/watch/*"];
VEV.checked? reQuest(url, VEV): dePre(url, VEV);
});
VEHO.addEventListener('change', ()=>{
var url=["http://www.veoh.com/*"];
VEHO.checked? reQuest(url, VEHO): dePre(url, VEHO);
});
});
1 change: 0 additions & 1 deletion Extension/popup/permit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ document.addEventListener('DOMContentLoaded', ()=>{
//! NOT global and must be delayed!
//Set
chrome.permissions.getAll(callback=>{
console.log(callback.origins);
info= callback.origins.toString();
if(info.includes("www.youtube.com/*")) YTB.checked= true;
if(info.includes("gaming.youtube.com/*")) GAME.checked= true;
Expand Down

0 comments on commit 39d581f

Please sign in to comment.