fix formatting and variable name #67

This commit is contained in:
oonuma ryouyu
2016-06-15 10:02:05 -07:00
parent 911053e825
commit 5829bae7d1
2 changed files with 11 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
<a href="#" id="tabs-reload">Reload active tab</a><br>
<a href="#" id="tabs-remove">Remove active tab</a><br>
<a href="#" id="tabs-create">Create a tab</a><br>
<a href="#" id="tabs-alertinfo">Alert active tab info</a><br>
<script src="tabs.js"></script>
</body>

View File

@@ -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();
});