detect Edge browser
This commit is contained in:
@@ -8,7 +8,7 @@ import config from '../config/config';
|
||||
import { SendHeartbeat } from '../types/heartbeats';
|
||||
import { GrandTotal, SummariesPayload } from '../types/summaries';
|
||||
import { ApiKeyPayload, AxiosUserResponse, User } from '../types/user';
|
||||
import { IS_FIREFOX, generateProjectFromDevSites } from '../utils';
|
||||
import { IS_FIREFOX, IS_EDGE, generateProjectFromDevSites } from '../utils';
|
||||
import { getApiKey } from '../utils/apiKey';
|
||||
import changeExtensionState from '../utils/changeExtensionState';
|
||||
import contains from '../utils/contains';
|
||||
@@ -340,6 +340,9 @@ class WakaTimeCore {
|
||||
if (IS_FIREFOX) {
|
||||
browserName = 'firefox';
|
||||
userAgent = navigator.userAgent.match(/Firefox\/\S+/g)![0];
|
||||
} else if (IS_EDGE) {
|
||||
browserName = 'edge';
|
||||
userAgent = navigator.userAgent;
|
||||
} else {
|
||||
userAgent = navigator.userAgent.match(/Chrome\/\S+/g)![0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user