Add working gifv support
This commit is contained in:
parent
0c2b28d11c
commit
757c92612c
|
@ -31,6 +31,7 @@ function copyToClipboard(url) {
|
||||||
|
|
||||||
chrome.pageAction.onClicked.addListener(function(tab) {
|
chrome.pageAction.onClicked.addListener(function(tab) {
|
||||||
getCurrentTabUrl(function(url) {
|
getCurrentTabUrl(function(url) {
|
||||||
|
url = getBetterUrl(url);
|
||||||
var filename = url.substr(url.lastIndexOf("/"));
|
var filename = url.substr(url.lastIndexOf("/"));
|
||||||
|
|
||||||
chrome.storage.sync.get({url: '', tabbehaviour: '', copytoclipboard: false, replacebookmark: false}, function(config) {
|
chrome.storage.sync.get({url: '', tabbehaviour: '', copytoclipboard: false, replacebookmark: false}, function(config) {
|
||||||
|
@ -69,13 +70,24 @@ chrome.pageAction.onClicked.addListener(function(tab) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function getBetterUrl(url) {
|
||||||
|
var extensionIndex = url.lastIndexOf('.');
|
||||||
|
var extension = url.substr(extensionIndex + 1);
|
||||||
|
|
||||||
|
if(extension == "gifv") {
|
||||||
|
return url.replace("gifv", "mp4");
|
||||||
|
}
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
function isCoolUrl(url) {
|
function isCoolUrl(url) {
|
||||||
url = url.toLowerCase();
|
url = url.toLowerCase();
|
||||||
|
|
||||||
var extensionIndex = url.lastIndexOf('.');
|
var extensionIndex = url.lastIndexOf('.');
|
||||||
var extension = url.substr(extensionIndex + 1);
|
var extension = url.substr(extensionIndex + 1);
|
||||||
|
|
||||||
var validExtensions = ["jpg", "jpeg", "png", "gif", "webm"];
|
var validExtensions = ["jpg", "jpeg", "png", "gif", "webm", "gifv"];
|
||||||
|
|
||||||
var blackList = ["pomf", "mixtape.moe", "catgirlsare.sexy", "cocaine.ninja"];
|
var blackList = ["pomf", "mixtape.moe", "catgirlsare.sexy", "cocaine.ninja"];
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
* Add imageboard thread archival support
|
* Add imageboard thread archival support
|
||||||
* Add booru support
|
* Add booru support
|
||||||
* Add imgur album support
|
* Add imgur album support
|
||||||
* Add gifv support
|
|
||||||
* Option to download a copy (checkbox)
|
* Option to download a copy (checkbox)
|
||||||
* Error checks and messages
|
* Error checks and messages
|
||||||
-->
|
-->
|
||||||
|
|
Loading…
Reference in New Issue