Skip to content

Commit

Permalink
Updated Facebook Module
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardo committed Oct 6, 2017
1 parent 691b6ee commit db2d804
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"manifest_version" : 2,
"author" : "Leonardo Ciaccio",
"version" : "6.1.7.0",
"version" : "6.1.7.2",
"name" : "Grab Any Media",
"default_locale" : "en",
"description" : "__MSG_des__",
Expand Down
32 changes: 32 additions & 0 deletions Extension/module/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,38 @@
callback = callback || function(){};

if( _getDomain( link ) != "facebook" )return [];

// ( IT ) --> Tento un recupero

var player = document.querySelector( "video[src='" + srcvideo + "']" );

if( !!player ){

var closest = player.closest( "[id^='hyperfeed_story_id']" );

if( !!closest ){

var
allLink = closest.querySelectorAll( "a" )

,href = ""
;

allLink.forEach( function( a, i ){

if( !!href )return false;

var aHREF = a.href;

if( /(?:\/videos\/\d+\/)|(?:\/video\.php\?v=\d+)/i.test( aHREF ) )href = aHREF;

} );

if( !!href )link = href;

}

}

if( !link.match( /^(https\:\/\/|http\:\/\/|\/\/).*facebook\..*\/.*\/videos\/:?/gi )/* &&
Expand Down
2 changes: 1 addition & 1 deletion Extension/module/facebook.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Extension/module/facebook.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db2d804

Please sign in to comment.