@@ -65,7 +65,7 @@ class ArchiveWebApp extends ReplayWebApp {
65
65
66
66
this . settingsError = "" ;
67
67
68
- this . settingsTab = localStorage . getItem ( "settingsTab" ) || "browsertrix " ;
68
+ this . settingsTab = localStorage . getItem ( "settingsTab" ) || "prefs " ;
69
69
70
70
try {
71
71
const res = localStorage . getItem ( "ipfsOpts" ) ;
@@ -91,6 +91,10 @@ class ArchiveWebApp extends ReplayWebApp {
91
91
this . btrixOpts = null ;
92
92
}
93
93
94
+ if ( ! self . localStorage . getItem ( "archiveCookies" ) ) {
95
+ self . localStorage . setItem ( "archiveCookies" , "1" ) ;
96
+ }
97
+
94
98
getLocalOption ( "autorunBehaviors" ) . then (
95
99
( res ) => ( this . autorun = res === "1" ) ,
96
100
) ;
@@ -987,10 +991,21 @@ class ArchiveWebApp extends ReplayWebApp {
987
991
}
988
992
989
993
renderSettingsModal ( ) {
994
+ let archiveCookies = false ,
995
+ archiveStorage = false ;
996
+ if ( this . settingsTab === "prefs" ) {
997
+ archiveCookies = self . localStorage . getItem ( "archiveCookies" ) === "1" ;
998
+ archiveStorage = self . localStorage . getItem ( "archiveStorage" ) === "1" ;
999
+ }
990
1000
return html `
991
1001
< wr-modal @modal-closed ="${ this . onCancelSettings } " title ="Settings ">
992
1002
< div class ="tabs mb-3 ">
993
1003
< ul >
1004
+ < li class ="${ this . settingsTab === "prefs" ? "is-active" : "" } ">
1005
+ < a @click =${ ( ) => ( this . settingsTab = "prefs" ) }
1006
+ > Archiving Privacy</ a
1007
+ >
1008
+ </ li >
994
1009
< li
995
1010
class ="${ this . settingsTab === "browsertrix" ? "is-active" : "" } "
996
1011
>
@@ -1008,6 +1023,51 @@ class ArchiveWebApp extends ReplayWebApp {
1008
1023
class ="is-flex is-flex-direction-column is-size-7 "
1009
1024
@submit ="${ this . onSaveSettings } "
1010
1025
>
1026
+ ${ this . settingsTab === "prefs"
1027
+ ? html ` < fieldset >
1028
+ < div class ="is-size-6 ">
1029
+ Control archiving of sensitive browser data.
1030
+ </ div >
1031
+ < div class ="field is-size-6 mt-4 ">
1032
+ < input
1033
+ name ="prefArchiveCookies "
1034
+ id ="archiveCookies "
1035
+ class ="checkbox "
1036
+ type ="checkbox "
1037
+ ?checked ="${ archiveCookies } "
1038
+ /> < span class ="ml-1 "> Archive cookies</ span >
1039
+ < p class ="is-size-7 mt-1 ">
1040
+ Archiving cookies may expose private information that is
1041
+ < em > normally only shared with the site</ em > . When enabled,
1042
+ users should exercise caution about sharing these archived
1043
+ items publicly.
1044
+ </ p >
1045
+ </ div >
1046
+ < div class ="field is-size-6 mt-4 ">
1047
+ < input
1048
+ name ="prefArchiveStorage "
1049
+ id ="archiveStorage "
1050
+ class ="checkbox "
1051
+ type ="checkbox "
1052
+ ?checked ="${ archiveStorage } "
1053
+ /> < span class ="ml-1 "> Archive local storage</ span >
1054
+ < p class ="is-size-7 mt-1 ">
1055
+ Archiving local storage will archive information that is
1056
+ generally < em > always private.</ em > Archiving local storage
1057
+ may be required for certain paywalled sites but should be
1058
+ avoided where possible.
1059
+ </ p >
1060
+ < p class ="is-size-7 mt-1 ">
1061
+ < strong
1062
+ > Sharing content created with this setting enabled may
1063
+ compromise your login credentials.</ strong
1064
+ >
1065
+ < br /> Archived items created with this settings should
1066
+ generally be kept private!
1067
+ </ p >
1068
+ </ div >
1069
+ </ fieldset > `
1070
+ : `` }
1011
1071
${ this . settingsTab === "ipfs"
1012
1072
? html ` < p class ="is-size-6 mb-3 ">
1013
1073
Configure settings for sharing archived items to IPFS.
@@ -1054,14 +1114,13 @@ class ArchiveWebApp extends ReplayWebApp {
1054
1114
? html `
1055
1115
< p class ="is-size-6 mb-3 ">
1056
1116
Configure your credentials to upload archived items to
1057
- Browsertrix.
1117
+ Browsertrix: Webrecorder's cloud-based crawling service .
1058
1118
</ p >
1059
1119
< p class ="is-size-7 p-4 has-background-info ">
1060
- Don't have a Browsertrix account? Visit
1061
- < a target ="_blank " href ="https://browsertrix.com / "
1062
- > https://browsertrix.com/ </ a
1120
+ Don't have a Browsertrix account?
1121
+ < a target ="_blank " href ="https://webrecorder.net/browsertrix / "
1122
+ > Sign up today! </ a
1063
1123
>
1064
- for more info.
1065
1124
</ p >
1066
1125
< fieldset >
1067
1126
< div class ="field has-addons ">
@@ -1276,7 +1335,7 @@ class ArchiveWebApp extends ReplayWebApp {
1276
1335
}
1277
1336
1278
1337
// @ts -expect-error - TS7006 - Parameter 'event' implicitly has an 'any' type.
1279
- async onTitle ( event ) {
1338
+ override async onTitle ( event ) : void {
1280
1339
super . onTitle ( event ) ;
1281
1340
1282
1341
if (
@@ -1363,6 +1422,23 @@ class ArchiveWebApp extends ReplayWebApp {
1363
1422
}
1364
1423
}
1365
1424
1425
+ const archiveCookies = this . renderRoot . querySelector ( "#archiveCookies" ) ;
1426
+ const archiveStorage = this . renderRoot . querySelector ( "#archiveStorage" ) ;
1427
+
1428
+ if ( archiveCookies ) {
1429
+ self . localStorage . setItem (
1430
+ "archiveCookies" ,
1431
+ ( archiveCookies as HTMLInputElement ) . checked ? "1" : "0" ,
1432
+ ) ;
1433
+ }
1434
+
1435
+ if ( archiveStorage ) {
1436
+ self . localStorage . setItem (
1437
+ "archiveStorage" ,
1438
+ ( archiveStorage as HTMLInputElement ) . checked ? "1" : "0" ,
1439
+ ) ;
1440
+ }
1441
+
1366
1442
localStorage . setItem ( "settingsTab" , this . settingsTab ) ;
1367
1443
1368
1444
// @ts -expect-error - TS2339 - Property 'showSettings' does not exist on type 'ArchiveWebApp'.
0 commit comments