Removed alarm code

This commit is contained in:
z0ccc 2022-08-02 23:56:27 -04:00
parent 94f761ede5
commit 3c97dd814c
2 changed files with 1 additions and 16 deletions

View file

@ -3,7 +3,7 @@
"name": "Vytal", "name": "Vytal",
"version": "2.0.0", "version": "2.0.0",
"description": "Spoof your location data and user agent.", "description": "Spoof your location data and user agent.",
"permissions": ["storage", "debugger", "activeTab", "alarms"], "permissions": ["storage", "debugger", "activeTab"],
"background": { "service_worker": "background.bundle.js" }, "background": { "service_worker": "background.bundle.js" },
"action": { "action": {
"default_popup": "popup.html", "default_popup": "popup.html",

View file

@ -1,5 +1,4 @@
import attachDebugger from '../../utils/attachDebugger' import attachDebugger from '../../utils/attachDebugger'
import userAgents from '../../utils/userAgents'
const attachTab = (tabId) => { const attachTab = (tabId) => {
chrome.debugger.getTargets((tabs) => { chrome.debugger.getTargets((tabs) => {
@ -21,17 +20,3 @@ chrome.tabs.onActivated.addListener((tab) => {
chrome.tabs.onUpdated.addListener((tabId) => { chrome.tabs.onUpdated.addListener((tabId) => {
attachTab(tabId) attachTab(tabId)
}) })
chrome.alarms.onAlarm.addListener((alarm) => {
if (alarm.name === 'userAgentAlarm') {
chrome.storage.sync.get(['randomUA'], (result) => {
if (result.randomUA) {
const randomUserAgent =
userAgents[Math.floor(Math.random() * userAgents.length)]
chrome.storage.sync.set({
userAgent: randomUserAgent,
})
}
})
}
})