File tree 1 file changed +7
-14
lines changed
1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,10 @@ exports.formatArgs = formatArgs;
11
11
exports . save = save ;
12
12
exports . load = load ;
13
13
exports . useColors = useColors ;
14
-
15
- /**
16
- * Use chrome.storage.local if we are in an app
17
- */
18
-
19
- var storage ;
20
-
21
- if ( typeof chrome !== 'undefined' && typeof chrome . storage !== 'undefined' )
22
- storage = chrome . storage . local ;
23
- else
24
- storage = localstorage ( ) ;
14
+ exports . storage = 'undefined' != typeof chrome
15
+ && 'undefined' != typeof chrome . storage
16
+ ? chrome . storage . local
17
+ : localstorage ( ) ;
25
18
26
19
/**
27
20
* Colors.
@@ -129,9 +122,9 @@ function log() {
129
122
function save ( namespaces ) {
130
123
try {
131
124
if ( null == namespaces ) {
132
- storage . removeItem ( 'debug' ) ;
125
+ exports . storage . removeItem ( 'debug' ) ;
133
126
} else {
134
- storage . debug = namespaces ;
127
+ exports . storage . debug = namespaces ;
135
128
}
136
129
} catch ( e ) { }
137
130
}
@@ -146,7 +139,7 @@ function save(namespaces) {
146
139
function load ( ) {
147
140
var r ;
148
141
try {
149
- r = storage . debug ;
142
+ r = exports . storage . debug ;
150
143
} catch ( e ) { }
151
144
return r ;
152
145
}
You can’t perform that action at this time.
0 commit comments