mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-26 11:10:55 +02:00
added logging statements
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
chrome.runtime.onMessage.addListener(notify);
|
chrome.runtime.onMessage.addListener(notify);
|
||||||
|
|
||||||
function notify(message) {
|
function notify(message) {
|
||||||
|
console.log("background script received message");
|
||||||
chrome.notifications.create({
|
chrome.notifications.create({
|
||||||
"type": "basic",
|
"type": "basic",
|
||||||
"iconUrl": chrome.extension.getURL("link.png"),
|
"iconUrl": chrome.extension.getURL("link.png"),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
window.addEventListener("click", notifyExtension);
|
window.addEventListener("click", notifyExtension);
|
||||||
|
|
||||||
function notifyExtension(e) {
|
function notifyExtension(e) {
|
||||||
|
console.log("content script sending message");
|
||||||
if (e.target.tagName != "A") {
|
if (e.target.tagName != "A") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Content scripting",
|
"name": "Notify link clicks",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"applications": {
|
"applications": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
|
|||||||
Reference in New Issue
Block a user