mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-26 11:58:53 +00:00
wip support experimental calendar api
This commit is contained in:
@@ -2,6 +2,30 @@ import { buildMeetingMessage } from "./lib/meeting-message.js";
|
||||
|
||||
console.log("[meeting-link] background loaded at", new Date().toISOString());
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
console.log("[meeting-link] browser.calendar exists?", !!browser.calendar);
|
||||
if (browser.calendar) {
|
||||
console.log("[meeting-link] calendar namespace keys:",
|
||||
Object.keys(browser.calendar));
|
||||
}
|
||||
|
||||
// Try the most basic read call — list configured calendars.
|
||||
// The exact method name varies between experiment versions; we'll
|
||||
// try the common one first.
|
||||
if (browser.calendar.calendars?.query) {
|
||||
const calendars = await browser.calendar.calendars.query({});
|
||||
console.log("[meeting-link] calendars found:", calendars.length, calendars);
|
||||
} else {
|
||||
console.warn("[meeting-link] calendars.query not present — namespace shape:",
|
||||
browser.calendar);
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.error("[meeting-link] calendar probe failed:", err);
|
||||
}
|
||||
})();
|
||||
|
||||
// Hardcoded for Spike 1. Spike 2 replaces this with a fetch() to your API.
|
||||
const STUB_MEETING_DATA = {
|
||||
url: "https://meet.example.com/m/abc-123-xyz",
|
||||
@@ -21,4 +45,4 @@ browser.runtime.onMessage.addListener(async (msg) => {
|
||||
return { ok: false, error: String(err.message || err) };
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,5 +18,24 @@
|
||||
"default_popup": "popup/popup.html",
|
||||
"default_icon": "icons/icon-32.png"
|
||||
},
|
||||
"permissions": ["compose"]
|
||||
}
|
||||
"permissions": ["compose"],
|
||||
"experiment_apis": {
|
||||
"calendar_provider": {
|
||||
"schema": "experiments/calendar/schema/calendar-provider.json",
|
||||
"parent": {
|
||||
"scopes": ["addon_parent"],
|
||||
"paths": [["calendar", "provider"]],
|
||||
"script": "experiments/calendar/parent/ext-calendar-provider.js",
|
||||
"events": ["startup"]
|
||||
}
|
||||
},
|
||||
"calendar_calendars": {
|
||||
"schema": "experiments/calendar/schema/calendar-calendars.json",
|
||||
"parent": {
|
||||
"scopes": ["addon_parent"],
|
||||
"paths": [["calendar", "calendars"]],
|
||||
"script": "experiments/calendar/parent/ext-calendar-calendars.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user