From a6f6cdd2f1060a5a42504728c8240a2a475eabc3 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Mon, 30 Oct 2017 15:33:35 +0100 Subject: [PATCH] FireFox Review --- Extension/manifest.json | 2 +- Extension/module/dailymotion.js | 10 ++++------ Extension/module/facebook.js | 12 +++++------- Extension/module/vimeo.js | 10 ++++------ Extension/module/youtube.js | 4 ++-- 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/Extension/manifest.json b/Extension/manifest.json index 675b64d..6aaadce 100644 --- a/Extension/manifest.json +++ b/Extension/manifest.json @@ -2,7 +2,7 @@ "manifest_version" : 2, "author" : "Leonardo Ciaccio", - "version" : "6.1.7.3", + "version" : "6.1.7.6", "name" : "Grab Any Media", "default_locale" : "en", "description" : "__MSG_des__", diff --git a/Extension/module/dailymotion.js b/Extension/module/dailymotion.js index 95ec75c..1d99309 100644 --- a/Extension/module/dailymotion.js +++ b/Extension/module/dailymotion.js @@ -15,9 +15,7 @@ "use strict"; var - externalAPI = "https://www.10convert.com/watch?v={%c}&utm_source=GrabAnyMedia&utm_medium=extension" - - ,api = "http://www.dailymotion.com/player/metadata/video/{%c}" + api = "http://www.dailymotion.com/player/metadata/video/{%c}" ,_noCache = function( link ){ @@ -140,9 +138,9 @@ ,_getVideoCode = function( link ){ var - reCanonical = /^(https\:\/\/|http\:\/\/|\/\/).*dailymotion\..*\/video\/:?/gi + reCanonical = /^(https\:\/\/|http\:\/\/|\/\/)(?:www\.)?dailymotion\..*\/video\/:?/gi - ,reEmbed = /^(https\:\/\/|http\:\/\/|\/\/).*dailymotion\..*\/embed\/video\/:?/gi + ,reEmbed = /^(https\:\/\/|http\:\/\/|\/\/)(?:www\.)?dailymotion\..*\/embed\/video\/:?/gi ,tmp ; @@ -249,7 +247,7 @@ _findLinks( videocode, function( response ){ - if( !response || response.length < 1 )return callback(); //return callback( externalAPI.replace( /\{\%c\}/gi, videocode ) ); + if( !response || response.length < 1 )return callback(); return callback( response ); diff --git a/Extension/module/facebook.js b/Extension/module/facebook.js index 4169e2a..e3d427c 100644 --- a/Extension/module/facebook.js +++ b/Extension/module/facebook.js @@ -15,9 +15,7 @@ "use strict"; var - externalAPI = "https://www.10convert.com/watch?v={%c}&utm_source=GrabAnyMedia&utm_medium=extension" - - ,_toDownload = function( newpage, link, title ){ + _toDownload = function( newpage, link, title ){ if( newpage ){ @@ -313,10 +311,10 @@ } } - - if( !link.match( /^(https\:\/\/|http\:\/\/|\/\/).*facebook\..*\/.*\/videos\/:?/gi )/* && + + if( !link.match( /^(https\:\/\/|http\:\/\/|\/\/)(?:www\.)?facebook\..*\/.*\/videos\/:?/gi )/* && - !link.match( /^(https\:\/\/|http\:\/\/|\/\/).*facebook\..*\/plugins\/video.php:?/gi ) + !link.match( /^(https\:\/\/|http\:\/\/|\/\/)(?:www\.)?facebook\..*\/plugins\/video.php:?/gi ) */){ alert( chrome.i18n.getMessage( "fb_to_video" ) ); @@ -327,7 +325,7 @@ _findLinks( link, function( response ){ - if( !response || response.length < 1 )return callback(); //return callback( externalAPI.replace( /\{\%c\}/gi, videocode ) ); + if( !response || response.length < 1 )return callback(); return callback( response ); diff --git a/Extension/module/vimeo.js b/Extension/module/vimeo.js index 36d7322..a2150c5 100644 --- a/Extension/module/vimeo.js +++ b/Extension/module/vimeo.js @@ -15,9 +15,7 @@ "use strict"; var - externalAPI = "https://www.10convert.com/watch?v={%c}&utm_source=GrabAnyMedia&utm_medium=extension" - - ,api = "https://player.vimeo.com/video/{%c}/config" + api = "https://player.vimeo.com/video/{%c}/config" ,_noCache = function( link ){ @@ -140,9 +138,9 @@ ,_getVideoCode = function( link ){ var - reCanonical = /^(https\:\/\/|http\:\/\/|\/\/).*vimeo\..*\/:?/gi + reCanonical = /^(https\:\/\/|http\:\/\/|\/\/)(?:www\.)?vimeo\..*\/:?/gi - ,reEmbed = /^(https\:\/\/|http\:\/\/|\/\/).*vimeo\..*\/video\/:?/gi + ,reEmbed = /^(https\:\/\/|http\:\/\/|\/\/)(?:www\.)?vimeo\..*\/video\/:?/gi ,tmp ; @@ -233,7 +231,7 @@ _findLinks( videocode, function( response ){ - if( !response || response.length < 1 )return callback(); //return callback( externalAPI.replace( /\{\%c\}/gi, videocode ) ); + if( !response || response.length < 1 )return callback(); return callback( response ); diff --git a/Extension/module/youtube.js b/Extension/module/youtube.js index 73db27d..e672e2f 100644 --- a/Extension/module/youtube.js +++ b/Extension/module/youtube.js @@ -161,9 +161,9 @@ ,_getVideoCode = function( link ){ var - reCanonical = /^(https\:\/\/|http\:\/\/|\/\/).*youtube\..*\/watch\?:?/gi + reCanonical = /^(https\:\/\/|http\:\/\/|\/\/)(?:www\.)?youtube\..*\/watch\?:?/gi - ,reEmbed = /^(https\:\/\/|http\:\/\/|\/\/).*youtube\..*\/embed\/:?/gi + ,reEmbed = /^(https\:\/\/|http\:\/\/|\/\/)(?:www\.)?youtube\..*\/embed\/:?/gi ; if( link.match( reCanonical ) ){