Skip to content

Commit

Permalink
Add a refresh button
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Nov 14, 2014
1 parent 38fe023 commit 6a32568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions abouttabs.html
Expand Up @@ -8,6 +8,7 @@
</head>
<body>
<h1>About Tabs</h1>
<button onclick="refresh()">Refresh</button>
<ul id="stats">
</ul>
</body>
Expand Down
6 changes: 4 additions & 2 deletions abouttabs.js
Expand Up @@ -4,8 +4,10 @@ const Cu = Components.utils;

Cu.import("resource://gre/modules/Services.jsm");

function init() {
function refresh() {
var ul = document.getElementById("stats");
while (ul.firstChild)
ul.removeChild(ul.firstChild);
var windows = Services.wm.getEnumerator("navigator:browser");
var windowsCount = 0;
var tabGroupsCount = 0;
Expand Down Expand Up @@ -148,4 +150,4 @@ function init() {
}
}

window.addEventListener("load", init, false);
window.addEventListener("load", refresh, false);

0 comments on commit 6a32568

Please sign in to comment.