Skip to content

Commit b180eca

Browse files
committed
use local storage for DEBUG status
1 parent bcf091f commit b180eca

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/utils.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/**
22
* Utility methods
33
*
4+
* @remarks
5+
* If you want to log events, errors, etc. locally during development,
6+
* save a true boolean key named isDevelopmentBuild to local storage
7+
*
48
* @module chrome/utils
59
*/
610

@@ -14,21 +18,13 @@
1418
*/
1519

1620
import * as ChromeLocale from './locales.js';
21+
import * as ChromeStorage from './storage.js';
1722

1823
declare var ChromePromise: any;
1924
const chromep = new ChromePromise();
2025

21-
/**
22-
* Set to true if development build
23-
*
24-
* @remarks
25-
*
26-
* Do not change name as it is processed during build
27-
*/
28-
const _DEBUG = false;
29-
3026
/** True if development build */
31-
export const DEBUG = _DEBUG;
27+
export const DEBUG = ChromeStorage.getBool('isDevelopmentBuild', false);
3228

3329
/** Get the extension's name
3430
*
@@ -157,6 +153,7 @@ export function isWhiteSpace(str: string | null | undefined) {
157153
* @returns A pseudo-random string
158154
*/
159155
export function getRandomString(len = 8) {
156+
// noinspection SpellCheckingInspection
160157
const POSS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
161158
let text = '';
162159
for (let i = 0; i < len; i++) {

0 commit comments

Comments
 (0)