Skip to content

Exception at start up

Environment

  • Browser and full version: Chrome 98.0.4758.82 & Edge 98.0.1108.43
  • Extension using this toolkit: test-mv2
  • Commit hash: e1f4204e

Steps to reproduce

  1. Load an extension with EWE included
  2. Run the following code in the background page console:
const randomKey = `file:///${new Date().getTime()}`;
const saveData = {};
saveData[randomKey] = {
  name: 'name',
  width: 250,
  height: 345,
  src: 'a base 64 string',
};
browser.storage.local.set(saveData).then(() => {
    console.log('done');
});
  1. Reload the extension
  2. An exception similar to the following will be thrown during start up:
       Uncaught (in promise) TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Function.from (<anonymous>)
    at ewe-api.js:13504:1
    at new Promise (<anonymous>)
    at saveFile (ewe-api.js:13502:1)
    at init (ewe-api.js:13532:1)
    at ewe-api.js:13344:1
    at async Module.start (ewe-api.js:15388:1)
    at async Promise.all (index 0)
    at async subscriptionInit.js:180:1

Actual behavior

An exception is thrown (see above), and no ads are blocked

Expected behavior

An exception should not be thrown at startup

Background information:

AdBlock has a custom image swap feature where Premium users can import up to 9 images to be used as image swap candidates. The images are converted to a base 64 string and stored in the browser.storage.local area with some additional meta data and a unique key. The unique key starts with the text: file:///..., and I believe this is the root cause of the issue.