18 lines
545 B
JavaScript
18 lines
545 B
JavaScript
chrome.runtime.onInstalled.addListener(function() {
|
|
// Set default settings on installation
|
|
chrome.storage.sync.set({
|
|
serverUrl: 'https://api.pragmatismo.com.br/general-bots/process',
|
|
enableProcessing: true,
|
|
hideContacts: false
|
|
});
|
|
});
|
|
|
|
// Listen for tab updates
|
|
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
|
if (changeInfo.status === 'complete' && tab.url && tab.url.includes('web.whatsapp.com')) {
|
|
// Inject content script
|
|
chrome.tabs.sendMessage(tabId, {
|
|
action: 'tabReady'
|
|
});
|
|
}
|
|
});
|