Here is my current manifest code:
{ "manifest_version": 2, "name": "Auto BCC", "version": "1.0", "description": "Automatically BCCs emails", "permissions": [ "tabs", "storage" ], "background": { "scripts": [ "bccchrome.js" ] } }
And here is the code for the bccchrome.js file:
// bccchrome.js
/**
// Initialize the extension runtime.onInstalled.addListener(() => { // Set a default BCC email storage.sync.set({ bccEmail: 'X...@gmail.com' }); });
// Listen for tab updates tabs.onUpdated.addListener((tabId, changeInfo, tab) => { if (tab.url.includes('mail.google.com') && tab.url.includes('/mail/u/0/#compose')) { storage.sync.get('bccEmail', (data) => { const bccEmail = data.bccEmail; tabs.executeScript(tabId, { code: document.querySelector('textarea[name="bcc"]').value = '${bccEmail}'; }); }); } }); }
Unchecked runtime.lastError: Cannot access contents of url "https://mail.google.com/mail/u/0/#inbox?compose=new". Extension manifest must request permission to access this host.
--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/6c3e6ae0-c8b8-4ae4-b6a8-22644ae2c122n%40chromium.org.