Open fregante opened 3 months ago
e.g.
chrome.action.onClicked.addListener(showErrors(() => { await chrome.permissions.request({origins: ['*://*/*']}) }))
would be equivalent to:
chrome.action.onClicked.addListener(() => { try { await chrome.permissions.request({origins: ['*://*/*']}) } catch (error) { await webextAlert(error) } });
See how ugly the try/catch looks for real code https://github.com/bfred-it/webext-domain-permission-toggle/blob/a803b62d76a2c0b2de7149bf336666fdcb644e3c/index.ts
e.g.
would be equivalent to: