mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 14:59:12 +02:00
19 lines
433 B
JavaScript
19 lines
433 B
JavaScript
const data = require("sdk/self").data;
|
|
const pageMod = require("sdk/page-mod");
|
|
const notifications = require("sdk/notifications");
|
|
|
|
pageMod.PageMod({
|
|
include: "*.mozilla.org",
|
|
contentScriptFile: [
|
|
data.url("content-script.js"),
|
|
],
|
|
onAttach: function(worker) {
|
|
worker.port.on("notify-attached-tab", (msg) => {
|
|
notifications.notify({
|
|
title: "Attached to tab",
|
|
text: msg
|
|
});
|
|
});
|
|
}
|
|
});
|