userAgent not getting cleared
This commit is contained in:
parent
deab90177b
commit
3a4127b191
2 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,4 @@
|
|||
import * as React from 'react'
|
||||
// import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
// import { faExternalLinkAlt, faCog } from '@fortawesome/free-solid-svg-icons';
|
||||
import Logo from '../../assets/img/logo.svg'
|
||||
import Link from '../../assets/img/link.svg'
|
||||
|
||||
|
|
@ -25,7 +23,7 @@ const Navbar = () => (
|
|||
alt="Vytal logo"
|
||||
/>
|
||||
<a
|
||||
href="https://locatejs.com"
|
||||
href="http://localhost:3000/scan.html"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
style={{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import React, { useState, useEffect } from 'react'
|
||||
import userAgents from '../../utils/userAgents'
|
||||
import detachDebugger from '../../utils/detachDebugger'
|
||||
|
||||
const UserAgentSettings = () => {
|
||||
const [userAgent, setUserAgent] = useState('')
|
||||
|
|
@ -19,15 +20,17 @@ const UserAgentSettings = () => {
|
|||
}, [])
|
||||
|
||||
const changeUserAgent = (e) => {
|
||||
detachDebugger()
|
||||
chrome.storage.sync.set({ userAgent: e.target.value })
|
||||
setUserAgent(e.target.value)
|
||||
}
|
||||
|
||||
const randomize = (e) => {
|
||||
detachDebugger()
|
||||
const randomUserAgent =
|
||||
userAgents[Math.floor(Math.random() * userAgents.length)]
|
||||
chrome.storage.sync.set({
|
||||
userAgent: randomUserAgent,
|
||||
userAgent: e.target.checked ? randomUserAgent : null,
|
||||
randomUA: e.target.checked,
|
||||
})
|
||||
e.target.checked ? setUserAgent(randomUserAgent) : setUserAgent('')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue