mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-22 17:22:55 +02:00
added short comments for all JS functions
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
Add notifyExtension() as a listener to click events.
|
||||
*/
|
||||
window.addEventListener("click", notifyExtension);
|
||||
|
||||
/*
|
||||
If the click was on a link, send a message to the background page.
|
||||
The message contains the link's URL.
|
||||
*/
|
||||
function notifyExtension(e) {
|
||||
var target = e.target;
|
||||
while ((target.tagName != "A" || !target.href) && target.parentNode) {
|
||||
|
||||
Reference in New Issue
Block a user