Added custom locales to debugger
This commit is contained in:
parent
7a18c1acd8
commit
fa799daf05
1 changed files with 7 additions and 4 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import countryLocales from '../../utils/countryLocales'
|
||||
|
||||
|
||||
const attachTab = (tabId, ipData) => {
|
||||
chrome.storage.sync.get(
|
||||
[
|
||||
|
|
@ -11,6 +10,8 @@ const attachTab = (tabId, ipData) => {
|
|||
'latitudeMatchIP',
|
||||
'lon',
|
||||
'longitudeMatchIP',
|
||||
'locale',
|
||||
'localeMatchIP',
|
||||
],
|
||||
(result) => {
|
||||
chrome.debugger.attach({ tabId: tabId }, '1.3', function () {
|
||||
|
|
@ -38,7 +39,11 @@ const attachTab = (tabId, ipData) => {
|
|||
chrome.debugger.sendCommand(
|
||||
{ tabId: tabId },
|
||||
'Emulation.setLocaleOverride',
|
||||
{ locale: countryLocales[result.ipData.countryCode].locale }
|
||||
{
|
||||
locale: result.localeMatchIP
|
||||
? countryLocales[result.ipData.countryCode].locale
|
||||
: result.locale,
|
||||
}
|
||||
)
|
||||
|
||||
const latitude = result.latMatchIP
|
||||
|
|
@ -48,8 +53,6 @@ const attachTab = (tabId, ipData) => {
|
|||
? result.ipData.lon
|
||||
: parseFloat(result.lon)
|
||||
|
||||
console.log(latitude, longitude)
|
||||
|
||||
chrome.debugger.sendCommand(
|
||||
{ tabId: tabId },
|
||||
'Emulation.setGeolocationOverride',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue