Skip to content

Commit

Permalink
Firefox Policy
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoCiaccio committed Mar 24, 2018
1 parent 589ccf0 commit 021bf21
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Extension/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"message": "You can comment all page online on all site, enjoy !"
},
"m22" : {
"message": "Help Us"
"message": "Help us to improve this extension enabling debug control with google analytics, please read our privacy policy: https://addons.mozilla.org/en-US/firefox/addon/grab-any-media/privacy/"
},
"m23" : {
"message": "❤ Thanks !"
Expand Down
2 changes: 1 addition & 1 deletion Extension/_locales/it/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"message": "Puoi commentare tutte le pagine online su qualsiasi sito !"
},
"m22" : {
"message": "Aiutaci"
"message": "Aiutaci a migliorare questa estensione abilitando il controllo in debug con google analytics, leggi la nostra privacy policy : https://addons.mozilla.org/it/firefox/addon/grab-any-media/privacy/"
},
"m23" : {
"message": "❤ Grazie !"
Expand Down
4 changes: 2 additions & 2 deletions Extension/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<meta charset="utf-8">

<script src="libs/google.analitics.js"></script>

<script src="libs/jquery.min.js"></script>
<script src="libs/jquery.gam.js"></script>

<script src="libs/google.analitics.js"></script>
<script src="libs/jquery.gam.extensions/jquery.gam.debug.js"></script>
<script src="libs/jquery.gam.extensions/jquery.gam.communication.js"></script>
<script src="libs/jquery.gam.extensions/jquery.gam.grab.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions Extension/console.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ <h1 class="ui icon header center aligned countmedia">
</div>
</div>
</div>
<!--

<div class="ui form">


Expand All @@ -336,7 +336,7 @@ <h1 class="ui icon header center aligned countmedia">


</div>
-->

</div>

</div>
Expand Down
16 changes: 16 additions & 0 deletions Extension/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,23 @@
// ( it ) --> monetize attivo ? rimosso

} );

chrome.runtime.onInstalled.addListener( function( details ){

if( !$.gam.config().monetize && ( details.reason == "install" || details.reason == "update" ) ){

// ( it ) --> Apro la finestra delle opzioni

var myopt = chrome.tabs.create( {

url : chrome.runtime.getManifest().options_page + "?optin=" + encodeURIComponent( chrome.i18n.getMessage( "m22" ) )

} );

}

});

window.myGA( "Extension", "new session", chrome.runtime.getManifest().version );

// ( it ) --> Genera un errore grave quando sono in fase test ( temporanea )
Expand Down
24 changes: 24 additions & 0 deletions Extension/js/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,31 @@
$( ".menu [data-tab='scan']" ).hide();
$( ".menu [data-tab='comments']" ).hide();
$( ".menu [data-tab='options']" ).trigger( "click" );
$( ".menu [data-tab='optmonetize']" ).trigger( "click" );

var params = location.search;

params = "{\"" +
params
.replace( /\?/gi, "" )
.replace( /\&/gi, "\",\"" )
.replace( /\=/gi, "\":\"" ) +
"\"}";

try{

params = JSON.parse( params );

if( params && params.optin && params.optin.trim() != "" ){

alert( decodeURIComponent( escapeHTML( params.optin.trim() ) ) );

}

}catch( e ){}



//return false;

}
Expand Down
10 changes: 7 additions & 3 deletions Extension/libs/google.analitics.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
*/


( function(){

( function($){

if( !$ || !$.gam )throw new Error( chrome.i18n.getMessage( "e1" ) );

// ( it ) --> Questo script viene utilizzato su diversi browser, non solo su firefox

var _getXHR = function(){
Expand Down Expand Up @@ -67,6 +69,8 @@

window.myGA = function( c, a, l ){

if( !$.gam.config().monetize )return;

var request = _getXHR();
if( !request )return false;

Expand All @@ -89,7 +93,7 @@

};

} )();
} )(window.jQuery);



Expand Down
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.8.2",
"version" : "6.1.8.3",
"name" : "Grab Any Media",
"default_locale" : "en",
"description" : "__MSG_des__",
Expand Down

0 comments on commit 021bf21

Please sign in to comment.