Fixed bugs with user agent
This commit is contained in:
parent
6f202aeae5
commit
867b9ef33d
3 changed files with 23 additions and 20 deletions
|
|
@ -27,15 +27,15 @@ const attachTab = (tabId, ipData) => {
|
|||
// 'Emulation.clearIdleOverride'
|
||||
// )
|
||||
|
||||
if (result.timezone) {
|
||||
chrome.debugger.sendCommand(
|
||||
{ tabId: tabId },
|
||||
'Emulation.setTimezoneOverride',
|
||||
{
|
||||
timezoneId: result.timezoneMatchIP
|
||||
? result.ipData.timezone
|
||||
: result.timezone,
|
||||
timezoneId: result.timezone,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
console.log(
|
||||
result.localeMatchIP,
|
||||
|
|
@ -48,15 +48,15 @@ const attachTab = (tabId, ipData) => {
|
|||
: result.locale
|
||||
)
|
||||
|
||||
if (result.locale) {
|
||||
chrome.debugger.sendCommand(
|
||||
{ tabId: tabId },
|
||||
'Emulation.setLocaleOverride',
|
||||
{
|
||||
locale: result.localeMatchIP
|
||||
? countryLocales[result.ipData.countryCode].locale
|
||||
: result.locale,
|
||||
locale: result.locale,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const latitude = result.latMatchIP
|
||||
? result.ipData.lat
|
||||
|
|
|
|||
|
|
@ -30,7 +30,10 @@ const DebugSettings = ({ type, title, ip }) => {
|
|||
}
|
||||
|
||||
const toggleMatchIP = (e) => {
|
||||
chrome.storage.sync.set({ [matchIPStorage]: !matchIP })
|
||||
chrome.storage.sync.set({
|
||||
[type]: ip[type],
|
||||
[matchIPStorage]: !matchIP,
|
||||
})
|
||||
!matchIP && setValue(ip[type])
|
||||
setMatchIP(e.target.checked)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const UserAgentSettings = () => {
|
|||
const randomUserAgent =
|
||||
userAgents[Math.floor(Math.random() * userAgents.length)]
|
||||
chrome.storage.sync.set({
|
||||
randomize: randomUserAgent,
|
||||
userAgent: randomUserAgent,
|
||||
randomUA: e.target.checked,
|
||||
})
|
||||
e.target.checked ? setUserAgent(randomUserAgent) : setUserAgent('')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue