fix: log whitelist wildcards (#175)

* chore: support for whitelist wildcards

* chore: solve warning on check html element

* chore: bump version 3.0.5
This commit is contained in:
Juan Sebastian velez Posada
2023-03-09 10:55:41 -05:00
committed by GitHub
parent 65c85d7264
commit c735e2dafa
4 changed files with 18 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import React, { useRef, useState, useEffect } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import config, { SuccessOrFailType } from '../config/config';
import apiKeyInvalid from '../utils/apiKey';
import { logUserIn } from '../utils/user';
@@ -253,7 +253,7 @@ export default function Options(): JSX.Element {
<div
onClick={() => setState({ ...state, trackSocialMedia: !state.trackSocialMedia })}
>
<input type="checkbox" checked={state.trackSocialMedia} />
<input type="checkbox" defaultChecked={state.trackSocialMedia} />
<span>Track social media sites</span>
</div>
<button

View File

@@ -1,15 +1,15 @@
/* eslint-disable no-fallthrough */
/* eslint-disable default-case */
import axios, { AxiosResponse } from 'axios';
import { IDBPDatabase, openDB } from 'idb';
import moment from 'moment';
import browser, { Tabs } from 'webextension-polyfill';
import { IDBPDatabase, openDB } from 'idb';
import { ApiKeyPayload, AxiosUserResponse, User } from '../types/user';
import config from '../config/config';
import { SummariesPayload, GrandTotal } from '../types/summaries';
import { SendHeartbeat } from '../types/heartbeats';
import { GrandTotal, SummariesPayload } from '../types/summaries';
import { ApiKeyPayload, AxiosUserResponse, User } from '../types/user';
import changeExtensionState from '../utils/changeExtensionState';
import contains from '../utils/contains';
import { SendHeartbeat } from '../types/heartbeats';
import getDomainFromUrl from '../utils/getDomainFromUrl';
class WakaTimeCore {
@@ -226,6 +226,16 @@ class WakaTimeCore {
url: schema + urlFromLine,
};
}
const lineRe = new RegExp(cleanLine.replace('.', '.').replace('*', '.*'));
// If url matches the current line return true
if (lineRe.test(url)) {
return {
project: null,
url: schema + urlFromLine,
};
}
}
return {

View File

@@ -26,5 +26,5 @@
"page": "options.html"
},
"permissions": ["alarms", "tabs", "storage", "idle"],
"version": "3.0.4"
"version": "3.0.5"
}

View File

@@ -39,5 +39,5 @@
"storage",
"idle"
],
"version": "3.0.4"
"version": "3.0.5"
}