File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "name" : " macify" ,
33 "version" : " 2.2.0" ,
44 "private" : true ,
5- "description" : " Transform Safari or Chrome's new tab into a macOS aerial screensaver." ,
5+ "description" : " Transform Chrome's new tab into a macOS aerial screensaver." ,
66 "license" : " MIT" ,
77 "type" : " module" ,
88 "scripts" : {
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export const cache = {
5959
6060export const sessionCache = {
6161 area ( ) {
62- return chrome . storage . session ;
62+ return chrome . storage ? .session ;
6363 } ,
6464 async get ( keys ) {
6565 const area = this . area ( ) ;
@@ -69,10 +69,17 @@ export const sessionCache = {
6969 return Object . fromEntries ( memorySession . entries ( ) ) ;
7070 }
7171 const result = { } ;
72+ if ( typeof keys === 'object' && ! Array . isArray ( keys ) ) {
73+ for ( const [ key , fallback ] of Object . entries ( keys ) ) {
74+ result [ key ] = memorySession . has ( key ) ? memorySession . get ( key ) : fallback ;
75+ }
76+ return result ;
77+ }
7278 const list = Array . isArray ( keys ) ? keys : [ keys ] ;
7379 for ( const key of list ) {
74- const value = memorySession . get ( key ) ;
75- if ( value !== undefined ) result [ key ] = value ;
80+ if ( memorySession . has ( key ) ) {
81+ result [ key ] = memorySession . get ( key ) ;
82+ }
7683 }
7784 return result ;
7885 } ,
You can’t perform that action at this time.
0 commit comments