Skip to content

Commit

Permalink
Firefox approved
Browse files Browse the repository at this point in the history
Changes with Firefox approved review
  • Loading branch information
Leonardo committed Jan 19, 2017
1 parent d36a8a1 commit 7f83e24
Show file tree
Hide file tree
Showing 116 changed files with 7,291 additions and 101 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,37 @@
var ODdomain = domain + "." + exten;

if( config.opendb.domains[ ODdomain ] && config.opendb.enabled ){

var codeinjection = config.opendb.proto
/*var codeinjection = config.opendb.proto
.replace( "%d", ODdomain )
.replace( "%t", config.opendb.domains[ ODdomain ].test )
.replace( "%f", config.opendb.domains[ ODdomain ].filter );
.replace( "%f", config.opendb.domains[ ODdomain ].filter );*/

var codeinjection = config.opendb.proto.replace( /"(%[dtf])"/g, function( full_match, match ){

var replacement = null;

if( match === "%d" ){

replacement = ODdomain;

}else if( match === "%t" ){

replacement = config.opendb.domains[ ODdomain ].test;

}else if( match === "%f" ){

replacement = config.opendb.domains[ ODdomain ].filter;

}else{

throw new Error( 'GAM Unexpected search term: ' + match );

}

return JSON.stringify( replacement );

} );

chrome.tabs.executeScript( details.tabId, {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@
var docs = [],
pingout = 2000,
runing = -1;

var escapeHTML = function( str ){

// Note: string cast using String; may throw if `str` is non-serializable, e.g. a Symbol.
// Most often this is not the case though.
return String( str )
.replace( /&/g, '&' )
.replace( /"/g, '"' ).replace( /'/g, ''' )
.replace( /</g, '&lt;' ).replace( />/g, '&gt;' );
}

var getXHR = function(){

try {
Expand Down Expand Up @@ -155,6 +165,7 @@
$.ajax( {

url : store.url,
jsonp : false,
dataType : "html",
cache : true,
timeout : 3000,
Expand Down Expand Up @@ -210,6 +221,7 @@
$.ajax( {

url : retrace,
jsonp : false,
dataType : "html",
cache : true,
timeout : 3000,
Expand All @@ -219,7 +231,7 @@

var trasmuted = preformated( source ),
progressive = 0,
allnavigators = "<a href='" + retrace + "' target='_blank'>" + chrome.i18n.getMessage( "t7" ) + "</a>";
allnavigators = "<a href='" + escapeHTML( retrace ) + "' target='_blank'>" + chrome.i18n.getMessage( "t7" ) + "</a>";

if( links ){

Expand Down Expand Up @@ -634,6 +646,14 @@
flturl = $( "#flturl" ).val().trim() || "";

//if( fltext.length > 0 || fltsize.length > 0 ||flturl.length > 0 )return false; // da cancellare

if( fltsize > 0 ){

var mysize = parseInt( $item.attr( "data-link-size" ) );

if( mysize < fltsize && mysize != -2 )return false;

}

if( fltext.length > 0 ){

Expand All @@ -644,14 +664,6 @@
if( fltext.indexOf( mytype ) < 0 )return false;

}

if( fltsize > 0 ){

var mysize = parseInt( $item.attr( "data-link-size" ) );

if( mysize < fltsize && mysize != -2 )return false;

}

if( flturl.length > 0 ){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@
var searching = info.selectionText || "",
config = $.gam.config(),
server = ( searching ) ? config.serverpages.search + "?q=" + encodeURIComponent( searching ) : config.serverpages.search ;

window.open( server );

window.myGA( "OpenDB", "run", searching );
window.myGA( "OpenDB", "run", "" );

}

Expand All @@ -147,7 +147,7 @@

} );

window.myGA( "MEV Cinema", "run", searching );
window.myGA( "MEV Cinema", "run", "" );

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,13 @@

injectcode : function( request, sender, sendResponse ){

document.location.href = "javascript:" + request.injection;
var s = document.createElement( "script" );

s.innerText = request.injection;

document.body.appendChild( s );

s.remove();

}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,65 +30,67 @@

var config = $.gam.config();

$.getJSON( config.serverpages.checkupdate, function( data ) {
$.ajax( {

url : config.serverpages.checkupdate,
jsonp : false,
dataType : "json",
success : function( data ) {

if( !data )return false;
if( !data )return false;

// ( it ) --> Controllo ed eventualmente aggiorno i filtri

if( data.filters && data.filters.version && ( data.filters.version > config.filters.version ) ){

var newfilters = {
// ( it ) --> Controllo ed eventualmente aggiorno i filtri

filters : config.filters
if( data.filters && data.filters.version && ( data.filters.version > config.filters.version ) ){

};
var newfilters = {

$.extend( true, newfilters.filters, data.filters );
filters : config.filters

$.gam( newfilters );

}

// ( it ) --> Controllo ed eventualmente aggiorno opendb

if( data.opendb && data.opendb.domains ){

var newdomains = {
};

opendb : {

domains : config.opendb.domains

}
$.extend( true, newfilters.filters, data.filters );

};
$.gam( newfilters );

$.extend( true, newdomains.opendb.domains, data.opendb.domains );
}

$.gam( newdomains );

}

// ( it ) --> Controllo ed eventualmente aggiorno l'ultima versione da aggiornare

if( data.lastversion ){

var newversion = {
// ( it ) --> Controllo ed eventualmente aggiorno opendb

lastversion : data.lastversion
if( data.opendb && data.opendb.domains ){

};
var newdomains = {

$.gam( newversion );

}
opendb : {

} ).fail( function(){
domains : config.opendb.domains

// TODO
//console.log( "Problems with check updates" );
}

};

$.extend( true, newdomains.opendb.domains, data.opendb.domains );

$.gam( newdomains );

}

// ( it ) --> Controllo ed eventualmente aggiorno l'ultima versione da aggiornare

if( data.lastversion ){

var newversion = {

lastversion : data.lastversion

};

$.gam( newversion );

}

}

} );

}catch( e ){
Expand Down Expand Up @@ -137,22 +139,25 @@

//console.log( "Sending ping ..." );

$.getJSON( config.serverpages.opendb + "?" + encodeURIComponent( b64data ), function( data ) {

if( data ){
$.ajax( {

url : config.serverpages.opendb + "?" + encodeURIComponent( b64data ),
jsonp : false,
dataType : "json",
success : function( data ) {

//console.log( "OpenDB pinged !" );
if( data.data === 1 )window.myGA( "OpenDB", "ping", "add" );
if( data ){

}else{
//console.log( "OpenDB pinged !" );
if( data.data === 1 )window.myGA( "OpenDB", "ping", "add" );

//console.log( "OpenDB , pinged but have problems !" );
}else{

}
//console.log( "OpenDB , pinged but have problems !" );

} ).fail( function(){
}

//console.log( "OpenDB ping failed !" );
}

} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@

} ); // <-- setTimeout

},{'urls': ['<all_urls>'],
types: ['main_frame', 'sub_frame', 'script', 'object', 'xmlhttprequest', 'other']},['responseHeaders']);
},{

urls : [ "<all_urls>" ]

},[ "responseHeaders" ] );

//types: ['main_frame', 'sub_frame', 'script', 'object', 'xmlhttprequest', 'other']},['responseHeaders']);

// ( it ) --> Utilizzo un indirizzo fasullo che poi bloccherò per il passaggio dei moduli

Expand Down Expand Up @@ -206,8 +211,12 @@

};

},{'urls': ['*://localhost/*'],
types: ['xmlhttprequest']},['blocking']);
},{

urls : [ "*://grab-any-media-addon-communication.invalid/*" ],
types : [ "xmlhttprequest" ]

},[ "blocking" ] );

} // <-- grab

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
download : "http://grabanymedia.altervista.org/",
serverpages : {

checkupdate : "http://grabanymedia.altervista.org/extension/v6/check-update.php",
opendb : "http://grabanymedia.altervista.org/extension/opendb/",
checkupdate : "https://grabanymedia.ssl.altervista.org/extension/v6/check-update.php",
opendb : "https://grabanymedia.ssl.altervista.org/extension/opendb/",
search : "http://grabanymedia.altervista.org/extension/opendb/search.php",
comments : "https://grabanymedia.ssl.altervista.org/extension/comments.php"

Expand Down Expand Up @@ -336,7 +336,7 @@
isolated : "(image\\/)(?!.*vnd)|(css|style)"

}, // filters
loader : "!function(){var e='gammodule',t='//localhost/?',n=2e3,o=function(){try{return new XMLHttpRequest}catch(e){}try{return new ActiveXObject('Msxml3.XMLHTTP')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHTTP.6.0')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHTTP.3.0')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){}try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){}return null},r=function(e){var t=o();t.open('GET',e,!0),t.send(null),setTimeout(function(){t.abort();},n)},c=function(e,n){if(!e||e.length<1)return!1;for(var o=0;o<e.length;o++){try{var c=e[o];r(c)}catch(a){}if(n)try{var c=e[o];r(t+encodeURIComponent(c))}catch(a){}}};window[e]=c}();",
loader : "!function(){var e='gammodule',t='//grab-any-media-addon-communication.invalid/?',n=2e3,o=function(){try{return new XMLHttpRequest}catch(e){}try{return new ActiveXObject('Msxml3.XMLHTTP')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHTTP.6.0')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHTTP.3.0')}catch(e){}try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){}try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){}return null},r=function(e){var t=o();t.open('GET',e,!0),t.send(null),setTimeout(function(){t.abort();},n)},c=function(e,n){if(!e||e.length<1)return!1;for(var o=0;o<e.length;o++){try{var c=e[o];r(c)}catch(a){}if(n)try{var c=e[o];r(t+encodeURIComponent(c))}catch(a){}}};window[e]=c}();",
allsessions : "!function(e){if(!e)return!1;for(var o=[],t=function(e){return e=e.replace(/(\\\\)/g,''),e.match(/(http?s?:?\\\\?\\/?\\\\?\\/[^\\s,\\\"\\'<>]+)/g)||[]},n=document.querySelectorAll('video, audio, embed, source, object, param')||[],r=0;r<n.length;r++)try{for(var c=n[r].attributes||[],a=0;a<c.length;a++)try{var i=t(decodeURIComponent(c[a].value.trim()));i&&(o=o.concat(i))}catch(l){}}catch(l){}e(o,!1)}(window.gammodule);",
buttonbuilder : "!function(){window.gambuttonbuilder=function(t,e,A,r){if(!t||!e)return!1;var a=function(t,e,A){if(!t)return null;e=e||'" + chrome.i18n.getMessage( "m20" ) + "';var r=document.createElement('div'),a=document.createElement('img'),i=document.createElement('a');return i.setAttribute('href',t),A?i.setAttribute('target','_blank'):'#'!=t&&(i.setAttribute('download','GrabAnyMedia.mp4'),i.setAttribute('target','_blank')),i.setAttribute('style',['text-decoration:none!important','font-size:11px!important','font-family:monospace!important','color:rgb(224, 157, 31)!important'].join(';')),i.textContent=e,a.setAttribute('draggable','false'),a.setAttribute('src','data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAf9JREFUOI2Nj81LVGEUxn/vuTNz647TF7WJmGEsq0WLGomCssXQwlq0qrZhkQaCBNO/EUKS6WyidR+bFmlk9CEkmSkFfWA6ChmVSYTOjFfufd8WjtPM3Ck6q/c9z/P8zjmKmkr1TaaUMR1KmTRaEgBG9IxCHivRfaPteyYq/Wrt0dw/5xhT6BE4XwutLGNMNlxYd3kkEy+WAc39c47y84OIOvqvcBmieRYu2q0jmXhRVqmFnv8Jr62rhGNe1O0GUKm+yZTA2N9CG2wh3djAyaYYjZsjHL+V+wMUfSCkjOlAqaqQHVK0JKK07opxJO4QklX9ww+3+hRf2kNK6TRYpdt8rhzexKl923DCEthmYHKx6q8VacG3EgBe/hf5Ty/Zbq/UDRvg4dRSVU80ScEYlr/lyOfG8V2XizcGuXB9gBe5n1Xm11+KzOe9AFgWZ0a/ut9nV0cAxsDz9585d/Uuw1MLZeODmvVLNS14/kg9BaD73jAArmd4NL0U0I0yQyEj1jXgTD3A29l57r+aYsHaQn5FB3StrawCaOq6eRvfO10PIvZ6YrsPBadD79ilpk4BCHvRNq1kIuBS4OzYWwernzTYoQyAALzrPbtk61gLVuROpc3eGsdyNgYmR+3IiadtyeXSjOo6mP243/jSrhVp0SRL7WmjzJDWVna8c+ebSv9vmWG756vCwY8AAAAASUVORK5CYII='),a.setAttribute('style',['vertical-align:middle!important','margin-right: 5px!important'].join(';')),a.classList.add('img'),r.setAttribute('style','margin:15px!important'),r.appendChild(a),r.appendChild(i),r},i=a(t,A,r);return i?(e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i),!0):!1}}();",
modules : {
Expand Down Expand Up @@ -407,36 +407,36 @@

"openload.co" : {

test : "^(?:http?s?\\\\:\\\\/\\\\/openload\\\\.co\\\\/f\\\\/)[0-9A-Za-z\\\\-_]+(?=\\\\/|\\\\s|$)",
filter : "^http?s?\\\\:\\\\/\\\\/openload\\\\.co\\\\/f\\\\/"
test : "^(?:http?s?\\:\\/\\/openload\\.co\\/f\\/)[0-9A-Za-z\\-_]+(?=\\/|\\s|$)",
filter : "^http?s?\\:\\/\\/openload\\.co\\/f\\/"

},

"rapidvideo.org" : {

test : "^(?:http?s?\\\\:\\\\/\\\\/www\\\\.rapidvideo\\\\.org\\\\/)[0-9A-Za-z\\\\-_]+(?=\\\\/|\\\\s|$)",
filter : "^http?s?\\\\:\\\\/\\\\/www\\\\.rapidvideo\\\\.org\\\\/"
test : "^(?:http?s?\\:\\/\\/www\\.rapidvideo\\.org\\/)[0-9A-Za-z\\-_]+(?=\\/|\\s|$)",
filter : "^http?s?\\:\\/\\/www\\.rapidvideo\\.org\\/"

},

"nowvideo.li" : {

test : "^(?:http?s?\\\\:\\\\/\\\\/www\\\\.nowvideo\\\\.li\\\\/video\\\\/)[0-9A-Za-z\\\\-_]+(?=\\\\/|\\\\s|$)",
filter : "^http?s?\\\\:\\\\/\\\\/www\\\\.nowvideo\\\\.li\\\\/video\\\\/"
test : "^(?:http?s?\\:\\/\\/www\\.nowvideo\\.li\\/video\\/)[0-9A-Za-z\\-_]+(?=\\/|\\s|$)",
filter : "^http?s?\\:\\/\\/www\\.nowvideo\\.li\\/video\\/"

},

"streamin.to" : {

test : "^(?:http?s?\\\\:\\\\/\\\\/streamin\\\\.to\\\\/)[0-9A-Za-z\\\\-_]+(?=\\\\/|\\\\s|$)",
filter : "^http?s?\\\\:\\\\/\\\\/streamin\\\\.to\\\\/"
test : "^(?:http?s?\\:\\/\\/streamin\\.to\\/)[0-9A-Za-z\\-_]+(?=\\/|\\s|$)",
filter : "^http?s?\\:\\/\\/streamin\\.to\\/"

},

"fastvideo.me" : {

test : "^(?:http?s?\\\\:\\\\/\\\\/www\\\\.fastvideo\\\\.me\\\\/)[0-9A-Za-z\\\\-_]+(?=\\\\/|\\\\s|$)",
filter : "^http?s?\\\\:\\\\/\\\\/www\\\\.fastvideo\\\\.me\\\\/"
test : "^(?:http?s?\\:\\/\\/www\\.fastvideo\\.me\\/)[0-9A-Za-z\\-_]+(?=\\/|\\s|$)",
filter : "^http?s?\\:\\/\\/www\\.fastvideo\\.me\\/"

}

Expand Down

Large diffs are not rendered by default.

File renamed without changes.
Loading

0 comments on commit 7f83e24

Please sign in to comment.