From 2f6bf705150add86e28ae7f0d84f5d14a9310b80 Mon Sep 17 00:00:00 2001 From: Philipp Kewisch Date: Wed, 7 Aug 2024 23:01:52 +0200 Subject: [PATCH] Adjust repository layout for NotificationBox --- .../NotificationBox/parent/ext-notification-box.js} | 0 .../NotificationBox/schema/notification-box.json} | 0 NotificationBox/manifest.json | 4 ++-- README.md | 13 +++++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) rename NotificationBox/{NotificationBox/implementation.js => experiments/NotificationBox/parent/ext-notification-box.js} (100%) rename NotificationBox/{NotificationBox/schema.json => experiments/NotificationBox/schema/notification-box.json} (100%) diff --git a/NotificationBox/NotificationBox/implementation.js b/NotificationBox/experiments/NotificationBox/parent/ext-notification-box.js similarity index 100% rename from NotificationBox/NotificationBox/implementation.js rename to NotificationBox/experiments/NotificationBox/parent/ext-notification-box.js diff --git a/NotificationBox/NotificationBox/schema.json b/NotificationBox/experiments/NotificationBox/schema/notification-box.json similarity index 100% rename from NotificationBox/NotificationBox/schema.json rename to NotificationBox/experiments/NotificationBox/schema/notification-box.json diff --git a/NotificationBox/manifest.json b/NotificationBox/manifest.json index 73e94b3..d1f9626 100644 --- a/NotificationBox/manifest.json +++ b/NotificationBox/manifest.json @@ -26,11 +26,11 @@ }, "experiment_apis": { "NotificationBox": { - "schema": "NotificationBox/schema.json", + "schema": "experiments/NotificationBox/schema/notification-box.json", "parent": { "scopes": ["addon_parent"], "paths": [["NotificationBox"]], - "script": "NotificationBox/implementation.js" + "script": "experiments/NotificationBox/parent/ext-notification-box.js" } } } diff --git a/README.md b/README.md index 35a666e..ea762f5 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,19 @@ official [communication channels](https://developer.thunderbird.net/add-ons/comm to tell you more about how they work, and engage in some ad-hoc discussion on how to design WebExtension APIs. +Using Experiments in your Add-ons +--------------------------------- + +The repository layout is conveniently written so you can collect the experiments in a subdirectory of your add-on. + +``` +mkdir -p my_addon_directory/experiments +cp -R webext-experiments/calendar/experiments/ my_addon_directory/experiments +``` + +Now copy the respective `experiment_apis` entries in e.g. `calendar/manifest.json` to your add-on's manifest.json. + + Migrating from Legacy Add-ons ----------------------------- If you are migrating your legacy add-on to WebExtensions, you may need to rethink how your UI is