@@ -144,19 +144,19 @@ webpg.background = {
144
144
145
145
webpg . plugin . get_webpg_status ( function ( res ) {
146
146
webpg . plugin . webpg_status = res ;
147
- webpg . utils . log ( "WebPG NPAPI Plugin valid: " + webpg . plugin . valid + "; version " + webpg . plugin . version ) ;
147
+ webpg . utils . log ( 'INFO' ) ( "WebPG NPAPI Plugin valid: " + webpg . plugin . valid + "; version " + webpg . plugin . version ) ;
148
148
149
149
// Set the users preferred option for the GnuPG binary
150
150
if ( webpg . plugin . valid ) {
151
151
var gnupgbin = webpg . preferences . gnupgbin . get ( ) ;
152
152
if ( gnupgbin . length > 1 ) {
153
153
webpg . plugin . gpgSetBinary ( gnupgbin ) ;
154
- webpg . utils . log ( "Setting GnuPG binary to user value: '" + gnupgbin + "'" ) ;
154
+ webpg . utils . log ( 'INFO' ) ( "Setting GnuPG binary to user value: '" + gnupgbin + "'" ) ;
155
155
}
156
156
var gpgconf = webpg . preferences . gpgconf . get ( ) ;
157
157
if ( gpgconf . length > 1 ) {
158
158
webpg . plugin . gpgSetGPGConf ( gpgconf ) ;
159
- webpg . utils . log ( "Setting GPGCONF binary to user value: '" + gpgconf + "'" ) ;
159
+ webpg . utils . log ( 'INFO' ) ( "Setting GPGCONF binary to user value: '" + gpgconf + "'" ) ;
160
160
}
161
161
}
162
162
@@ -165,11 +165,11 @@ webpg.background = {
165
165
this . banner_version = "9.4" ;
166
166
167
167
if ( gnupghome . length > 0 )
168
- webpg . utils . log ( "Setting GnuPG home directory to user value: '" + gnupghome + "'" ) ;
168
+ webpg . utils . log ( 'INFO' ) ( "Setting GnuPG home directory to user value: '" + gnupghome + "'" ) ;
169
169
if ( webpg . plugin . webpg_status . openpgp_detected )
170
- webpg . utils . log ( "Protocol OpenPGP is valid; v" + webpg . plugin . webpg_status . OpenPGP . version ) ;
170
+ webpg . utils . log ( 'INFO' ) ( "Protocol OpenPGP is valid; v" + webpg . plugin . webpg_status . OpenPGP . version ) ;
171
171
if ( webpg . plugin . webpg_status . gpgconf_detected )
172
- webpg . utils . log ( "Protocol GPGCONF is valid; v" + webpg . plugin . webpg_status . GPGCONF . version ) ;
172
+ webpg . utils . log ( 'INFO' ) ( "Protocol GPGCONF is valid; v" + webpg . plugin . webpg_status . GPGCONF . version ) ;
173
173
//webpg.plugin.gpgSetHomeDir(gnupghome);
174
174
webpg . plugin . addEventListener ( "keygenprogress" , webpg . background . gpgGenKeyProgress , false ) ;
175
175
webpg . plugin . addEventListener ( "keygencomplete" , webpg . background . gpgGenKeyComplete , false ) ;
@@ -199,7 +199,7 @@ webpg.background = {
199
199
webpg . background . tabIndex = 100 ;
200
200
webpg . utils . tabListener . add ( ) ;
201
201
}
202
- webpg . utils . log ( "WebPG background initialized" ) ;
202
+ webpg . utils . log ( 'INFO' ) ( "WebPG background initialized" ) ;
203
203
} ) ;
204
204
// Display the welcome notice if appropriate
205
205
var banner_version = webpg . preferences . banner_version . get ( ) ;
@@ -374,7 +374,7 @@ webpg.background = {
374
374
try {
375
375
chrome . browserAction . setBadgeText ( { 'text' : request . badgeText , 'tabId' : sender . tab . id } ) ;
376
376
} catch ( err ) {
377
- webpg . utils . log ( err . message ) ;
377
+ webpg . utils . log ( 'ERROR' ) ( err . message ) ;
378
378
}
379
379
break ;
380
380
@@ -387,7 +387,7 @@ webpg.background = {
387
387
break ;
388
388
389
389
case 'decrypt' :
390
- webpg . utils . log ( "gpgDecrypt requested" ) ;
390
+ webpg . utils . log ( 'INFO' ) ( "gpgDecrypt requested" ) ;
391
391
webpg . plugin . gpgDecrypt ( request . data , function ( response ) {
392
392
response . original_text = request . data ;
393
393
if ( response . error === true )
@@ -505,7 +505,7 @@ webpg.background = {
505
505
break ;
506
506
507
507
case 'async-gpgGenKey' :
508
- webpg . utils . log ( "async-gpgGenKey requested" ) ;
508
+ webpg . utils . log ( 'INFO' ) ( "async-gpgGenKey requested" ) ;
509
509
webpg . plugin . gpgGenKey (
510
510
request . data . publicKey_algo ,
511
511
request . data . publicKey_size ,
@@ -521,7 +521,7 @@ webpg.background = {
521
521
break ;
522
522
523
523
case 'async-gpgGenSubKey' :
524
- webpg . utils . log ( "async-gpgGenSubKey requested" ) ;
524
+ webpg . utils . log ( 'INFO' ) ( "async-gpgGenSubKey requested" ) ;
525
525
webpg . plugin . gpgGenSubKey (
526
526
request . data . key_id ,
527
527
request . data . subKey_algo ,
@@ -535,7 +535,7 @@ webpg.background = {
535
535
break ;
536
536
537
537
case 'doKeyImport' :
538
- webpg . utils . log ( "doKeyImport requested" ) ;
538
+ webpg . utils . log ( 'INFO' ) ( "doKeyImport requested" ) ;
539
539
request . bypassSendResult = true ;
540
540
function processResult ( import_status ) {
541
541
if ( import_status . error || ! import_status . imports ||
@@ -560,7 +560,7 @@ webpg.background = {
560
560
webpg . plugin . gpgImportKey ( request . data , processResult ) ;
561
561
}
562
562
} catch ( err ) {
563
- webpg . utils . log ( err ) ;
563
+ webpg . utils . log ( 'ERROR' ) ( err ) ;
564
564
}
565
565
} ;
566
566
if ( request . temp_context ) {
@@ -595,14 +595,14 @@ webpg.background = {
595
595
request . signers !== null &&
596
596
request . signers . length > 0 ) ? request . signers : [ ] ;
597
597
if ( request . recipients . length > 0 ) {
598
- webpg . utils . log ( request . data , request . recipients ) ;
598
+ webpg . utils . log ( 'INFO' ) ( request . data , request . recipients ) ;
599
599
webpg . plugin . gpgEncrypt (
600
600
request . data ,
601
601
request . recipients ,
602
602
sign ,
603
603
signers ,
604
604
function ( response ) {
605
- webpg . utils . log ( response ) ;
605
+ webpg . utils . log ( 'INFO' ) ( response ) ;
606
606
if ( typeof ( request . message_event ) === 'undefined' || request . message_event !== "gmail" )
607
607
webpg . utils . tabs . sendRequest ( sender . tab , {
608
608
"msg" : "insertEncryptedData" ,
@@ -621,7 +621,7 @@ webpg.background = {
621
621
break ;
622
622
623
623
case 'encryptSign' :
624
- webpg . utils . log ( "encrypt requested" ) ;
624
+ webpg . utils . log ( 'INFO' ) ( "encrypt requested" ) ;
625
625
if ( request . recipients && request . recipients . length > 0 ) {
626
626
response = webpg . plugin . gpgEncrypt ( request . data ,
627
627
request . recipients , 1 , request . signers ) ;
@@ -637,13 +637,13 @@ webpg.background = {
637
637
break ;
638
638
639
639
case 'symmetricEncrypt' :
640
- webpg . utils . log ( "symmetric encryption requested" ) ;
640
+ webpg . utils . log ( 'INFO' ) ( "symmetric encryption requested" ) ;
641
641
var signers = ( typeof ( request . signers ) !== 'undefined' &&
642
642
request . signers !== null &&
643
643
request . signers . length > 0 ) ? request . signers : [ ] ;
644
644
var sign = ( signers . length > 0 ) ? 1 : 0 ;
645
645
webpg . plugin . gpgSymmetricEncrypt ( request . data , sign , signers , function ( response ) {
646
- webpg . utils . log ( request ) ;
646
+ webpg . utils . log ( 'INFO' ) ( request ) ;
647
647
if ( request . message_event === "context" || request . message_event === "editor" )
648
648
webpg . utils . tabs . sendRequest ( sender . tab , {
649
649
"msg" : "insertEncryptedData" ,
@@ -664,7 +664,7 @@ webpg.background = {
664
664
break ;
665
665
666
666
case 'deleteKey' :
667
- webpg . utils . log ( "deleteKey requested" ) ;
667
+ webpg . utils . log ( 'INFO' ) ( "deleteKey requested" ) ;
668
668
if ( request . temp_context ) {
669
669
temp_path = webpg . plugin . getTemporaryPath ( ) ;
670
670
if ( ! temp_path )
@@ -682,7 +682,7 @@ webpg.background = {
682
682
break ;
683
683
684
684
case 'getNamedKey' :
685
- webpg . utils . log ( "getNamedKey requested" ) ;
685
+ webpg . utils . log ( 'INFO' ) ( "getNamedKey requested" ) ;
686
686
request . bypassSendResult = true ;
687
687
function getNamedKey ( ) {
688
688
webpg . plugin . getNamedKey ( request . key_id , false , false , function ( response ) {
@@ -791,7 +791,7 @@ webpg.background = {
791
791
792
792
case 'log' :
793
793
response = null ;
794
- webpg . utils . log ( "Remote log request recieved; " , request . data ) ;
794
+ webpg . utils . log ( 'INFO' ) ( "Remote log request recieved; " , request . data ) ;
795
795
break ;
796
796
797
797
case 'create_menu' :
@@ -824,7 +824,7 @@ webpg.background = {
824
824
break ;
825
825
826
826
case 'sendPGPMIMEMessage' :
827
- webpg . utils . log ( request ) ;
827
+ webpg . utils . log ( 'INFO' ) ( request ) ;
828
828
webpg . plugin . sendMessage ( request . params , function ( response ) {
829
829
sendResponse ( { 'result' : response } ) ;
830
830
} ) ;
@@ -886,7 +886,7 @@ webpg.background = {
886
886
doc . body . removeEventListener ( 'gpgkeylistprogress' , contentWindow . webpg . keymanager . keylistprogress ) ;
887
887
} catch ( err ) {
888
888
// We don't really care if it didn't already exist
889
- webpg . utils . log ( err ) ;
889
+ webpg . utils . log ( 'INFO' ) ( err ) ;
890
890
} finally {
891
891
// Add the listener
892
892
doc . body . addEventListener ( 'gpgkeylistprogress' , contentWindow . webpg . keymanager . keylistprogress ) ;
@@ -947,7 +947,7 @@ webpg.background = {
947
947
doc . body . removeEventListener ( 'progress' , contentWindow . webpg . keymanager . progressMsg ) ;
948
948
} catch ( err ) {
949
949
// We don't really care if it didn't already exist
950
- webpg . utils . log ( err . message ) ;
950
+ webpg . utils . log ( 'ERROR' ) ( err . message ) ;
951
951
} finally {
952
952
// Add the listener
953
953
doc . body . addEventListener ( 'progress' , contentWindow . webpg . keymanager . progressMsg ) ;
0 commit comments