File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 6
6
<key >DefaultValue </key >
7
7
<false />
8
8
<key >FalseValue </key >
9
- <false / >
9
+ <string > false </ string >
10
10
<key >Key </key >
11
11
<string >open_prefs </string >
12
12
<key >Secure </key >
13
13
<false />
14
14
<key >Title </key >
15
15
<string >Click to see the Preferences </string >
16
16
<key >TrueValue </key >
17
- <true / >
17
+ <string > true </ string >
18
18
<key >Type </key >
19
19
<string >CheckBox </string >
20
20
</dict >
Original file line number Diff line number Diff line change 300
300
if ( typeof callback !== "function" ) {
301
301
return ;
302
302
}
303
- var i , size = 0 ;
304
- for ( i in this . _storage ) {
305
- if ( ! this . _storage . hasOwnProperty ( i ) ) continue ;
306
- size += ( this . _storage [ i ] || '' ) . length ;
307
- }
308
- callback ( size ) ;
303
+ callback ( 0 ) ;
304
+ // Too slow:
305
+ var getBytesInUseHandler = function ( cacheSize ) {
306
+ var i , storage = settingsStorage . _storage ;
307
+ for ( i in storage ) {
308
+ if ( ! storage . hasOwnProperty ( i ) ) continue ;
309
+ cacheSize += ( storage [ i ] || '' ) . length ;
310
+ }
311
+ callback ( cacheSize ) ;
312
+ } ;
313
+ vAPI . cacheStorage . getBytesInUse ( null , getBytesInUseHandler ) ;
309
314
}
310
315
} ;
311
316
312
317
vAPI . storage = settingsStorage ;
313
318
314
- if ( ! safari . extension . settings . migratedStorage ) {
319
+ if ( ! settingsStorage . get ( ' migratedStorage' ) ) {
315
320
var migrationMap = {
316
321
"cached_asset_content://assets/user/filters.txt" : "userFilters"
317
322
} ;
354
359
delayed = null ;
355
360
vAPI . storage = settingsStorage ;
356
361
} ) ;
357
- safari . extension . settings . migratedStorage = true ;
362
+ settingsStorage . set ( { ' migratedStorage' : true } ) ;
358
363
}
359
364
360
365
/******************************************************************************/
You can’t perform that action at this time.
0 commit comments