chore: add support for Content scripts (#182)
* chore: add support for Content scripts * chore: run script bae on browser * chore: content script supporting canva website * chore: add 2 minutes debounce for onclik events * chore: add debounce for keypress events
This commit is contained in:
committed by
GitHub
parent
c2ead5149d
commit
7d795f854f
@@ -1,3 +1,6 @@
|
||||
import browser from 'webextension-polyfill';
|
||||
import config from '../config/config';
|
||||
|
||||
export default function apiKeyInvalid(key?: string): string {
|
||||
const err = 'Invalid api key... check https://wakatime.com/settings for your key';
|
||||
if (!key) return err;
|
||||
@@ -8,3 +11,11 @@ export default function apiKeyInvalid(key?: string): string {
|
||||
if (!re.test(key)) return err;
|
||||
return '';
|
||||
}
|
||||
|
||||
export async function getApiKey(): Promise<string> {
|
||||
const storage = await browser.storage.sync.get({
|
||||
apiKey: config.apiKey,
|
||||
});
|
||||
const apiKey = storage.apiKey as string;
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user