mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
12 lines
312 B
JavaScript
12 lines
312 B
JavaScript
chrome.runtime.onMessage.addListener(notify);
|
|
|
|
function notify(message) {
|
|
console.log("background script received message");
|
|
chrome.notifications.create({
|
|
"type": "basic",
|
|
"iconUrl": chrome.extension.getURL("icons/link-48.png"),
|
|
"title": "You clicked a link!",
|
|
"message": message.url
|
|
});
|
|
}
|