-
Open the DevTools and go into the settings via the Gear Icon
-
Ensure "Enable browser chrome and add-on debugging toolboxes" is checked.
-
Open the browser console
- Tools > Web Developer > Browser Console
- Cmd + Shift + J
-
Run the following in the console:
Cu.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", {}).RecipeRunner.checkFilter({ id: 1, arguments: {}, filter_expression: FILTER_TO_TEST, }).then(result => console.log(result))
For example:
Cu.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", {}).RecipeRunner.checkFilter({ id: 1, arguments: {}, filter_expression: 'true', }).then(result => console.log(result))
You can use backticks for multi-line expressions:
Cu.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", {}).RecipeRunner.checkFilter({ id: 1, arguments: {}, filter_expression: ` ( true && normandy.country == "US" ) `, }).then(result => console.log(result))
-
The console will output a
Promise
object, and then logtrue
orfalse
depending on whether the expression passed for your client or not.
- Certain filters, particular filters that involve
normandy.recipe
, may not work as expected, as they rely on theid
andarguments
fields passed in. - If you are using time-based or geolocation-based filters, which rely on the Normandy service, this method may fail if you've configured Firefox to point towards a local instance of Normandy which is not running.