mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 14:59:12 +02:00
16 lines
275 B
JavaScript
16 lines
275 B
JavaScript
"use strict";
|
|
|
|
browser.runtime.onMessage.addListener(msg => {
|
|
const {type} = msg;
|
|
|
|
switch (type) {
|
|
case "notify-attached-tab":
|
|
browser.notifications.create({
|
|
type: "basic",
|
|
title: "Attached to tab",
|
|
message: msg.message
|
|
});
|
|
break;
|
|
}
|
|
});
|