Skip to content

Commit

Permalink
first listener added. see micz/ThunderAI#182
Browse files Browse the repository at this point in the history
  • Loading branch information
micz committed Dec 30, 2024
1 parent 195ec55 commit 88dea3e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion mztas-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// ============== FOR TESTING ==============
browser.browserAction.onClicked.addListener(() => {
testThunderAISparks();
});
Expand All @@ -32,4 +33,21 @@ browser.messageDisplayAction.onClicked.addListener(() => {
summary: "ThunderAI Sparks",
forceAllDay: false
});
}
}
// =========================================

// Listen for messages
browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
console.log("Message received:", message);
console.log("Sender info:", sender);

sendResponse({ response: "Message received successfully!" });

switch (message.action) {
case "openCalendarDialog":
browser.CalendarTools.openCalendarDialog(message.data);
break;
}

return true;
});

0 comments on commit 88dea3e

Please sign in to comment.