I'm trying to cancel a web-request whenever a new tab is opened. I wanted to check this via webNavigation.onCreatedNavigationTarget, but that event seems to be activated "long" after the webRequest.onBeforeRequest.
So I use property Tab.openerTabId to find out if a tab has been opened by another tab. The problem is, I need to get the tab instance (details) by doing a Tag.get(details.tabId), but this is a callback and I cannot return the main function from a callback. Therefor the return {cancel: true} is not recognized and the web-request goes through.
I'm using Tab.onCreated to store the tab, but it's a 50 % chance of being executed after onBeforeRequest.
I've been looking online but in no way I'm able to fix or get around this issue. Is there anything I could do?