Safari Extensions Permission Banner Not Documented #741
Labels
needs-triage: chrome
Chrome needs to assess this issue for the first time
needs-triage: firefox
Firefox needs to assess this issue for the first time
needs-triage: safari
Safari needs to assess this issue for the first time
I’m trying to figure out how to trigger the "Additional Permissions Requested" banner, like what extensions like Honey and Coupert do, but I haven’t had any luck. I've attached an example of the banner to this email. We’ve got <all_urls> in the manifest, but because Safari exposes the ability to only give permission for the extension to run on certain domains, its possible for us to not ACTUALLY have the <all_urls> permission. In these situations, I’ve been trying things like dynamically requesting permissions and injecting scripts when tabs are created, activated, or navigated.
For example: chrome.webNavigation.onCommitted.addListener(async ({ tabId, url }) => { try { await chrome.permissions.request({ permissions: ['scripting'], origins: [url!], }); await chrome.scripting.executeScript({ target: { tabId: tabId!, allFrames: false }, func: () => console.log('Injected'), world: 'ISOLATED', }); } catch (e) { console.error('Failed to inject script', e); } }); I’ve also hooked into tabs.onActivated, webNavigation.onDOMContentLoaded, and tabs.onCreated events, but nothing seems to trigger the banner.
Is there something I’m missing about how Safari handles this? Any advice or pointers would be super helpful.
The text was updated successfully, but these errors were encountered: