diff --git a/tabs-tabs-tabs/tabs.html b/tabs-tabs-tabs/tabs.html index c59ea16..afcf29a 100644 --- a/tabs-tabs-tabs/tabs.html +++ b/tabs-tabs-tabs/tabs.html @@ -13,6 +13,7 @@ Reload active tab
Remove active tab
Create a tab
+ Alert active tab info
diff --git a/tabs-tabs-tabs/tabs.js b/tabs-tabs-tabs/tabs.js index badc21b..4b09ffd 100644 --- a/tabs-tabs-tabs/tabs.js +++ b/tabs-tabs-tabs/tabs.js @@ -60,5 +60,15 @@ document.addEventListener("click", function(e) { chrome.tabs.create({url: "https://developer.mozilla.org/en-US/Add-ons/WebExtensions"}); } + else if (e.target.id === "tabs-alertinfo") { + callOnActiveTab((tab) => { + let props = ""; + for (let item in tab) { + props += `${ item } = ${ tab[item] } \n`; + } + alert(props); + }); + } + e.preventDefault(); });