Error thrown when calling filters.isResourceAllowlisted() on updated new tab
Environment
- Browser and full version: Chrome 97.0.4692.71
- Extension using this toolkit: test-mv2
- Commit hash: a13af03f
Steps to reproduce
- Run
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => EWE.filters.isResourceAllowlisted(tab.url, "document", tab.id))
in background page. - Open a new tab.
Actual behavior
No error is thrown.
Expected behavior
The following error is thrown:
Error in event handler: TypeError: Cannot read properties of undefined (reading 'href')
at Function.exports.URLRequest.from (chrome-extension://gokpgjbpdjfjkfionogdcmhfmkklnnlm/ewe-api.js:11071:23)
at Matcher.match (chrome-extension://gokpgjbpdjfjkfionogdcmhfmkklnnlm/ewe-api.js:6771:30)
at CombinedMatcher.isAllowlisted (chrome-extension://gokpgjbpdjfjkfionogdcmhfmkklnnlm/ewe-api.js:7033:29)
at Object.isResourceAllowlisted (chrome-extension://gokpgjbpdjfjkfionogdcmhfmkklnnlm/ewe-api.js:13641:86)
at <anonymous>:1:75
Further information
This regression was introduced in #136 (closed).
Adblock Plus revalidates a tab's allowlisting state whenever the tab is updated (see lib/allowlisting.js).
Edited by Thomas Greiner