Import, export and Add to Placebo
Export
Export in the header downloads every rule and folder as placebo-api-rules-YYYY-MM-DD.json. Use it as a backup, to move rules to another browser, or to send a set of mocks to a teammate.
Import
Import checks the file first and shows what it contains, then lets you add it after your current rules or replace everything. Imported rules always get new ids. A file with a problem is refused with the exact reason (for example items[2].matchType), and nothing changes.
If the file has more rules than your plan allows, only its first rules (in priority order) are imported, and rules past the active limit arrive switched off. The dialog tells you before anything changes.
Importing from Requestly
Export your rules from Requestly as JSON and import the file. Groups become folders, active and inactive rules keep their state, and priority is kept. Converted:
- Modify Response rules, static or dynamic (JavaScript) New in 1.2
- Modify Headers, Cancel (becomes Block) and Redirect to a URL New in 1.2
- URL, host and path conditions (contains, equals, wildcard, regex) and request-method filters
Anything that can’t be converted, such as other rule types, request-body filters or redirects to local files, is skipped and listed in the import dialog.
Add to Placebo buttons New in 1.2
Pages on placeboapi.com can offer ready-made rules with an Add to Placebo API button. Clicking it opens the import dialog in the extension with that rule, and nothing is added until you confirm. Only placeboapi.com can do this, and only when you click. Try it: this rule makes our demo page get a 500.
Install Placebo API to use this rule
Something unclear or missing? Tell me, and I'll fix the docs.