What steps will reproduce the problem?
1. Add some rules to a declarative event (e.g., declarativeWebRequest.onRequest).
2. Call getRules(function() {...})
What is the expected result?
The callback should be invoked with all the rules.
What happens instead of that?
An error is thrown for an invalid invocation.
Please provide any additional information below. Attach a screenshot if
possible.
In extension API calls, we allow optional parameters to be omitted, and the filter list is defined as optional in the spec/documentation (and we allow it to be null or undefined). The reason this fails is because the get/removeRules functions are defined in event.js as taking two parameters, and validate against those rather than against `arguments`. This means that the validation sees the callback as the filter argument, and throws an error.
Native bindings do the right thing here, so when those go out, this will be fixed. Filing this for documentation (and reminding) purposes.
Comment 1 by bugdroid1@chromium.org
, Jun 15 2017