Skip to content

Commit

Permalink
Add a "Refresh" option to the hamburger menu
Browse files Browse the repository at this point in the history
Fixes #127

Also added note about commit 7063882,
which I may want to grab if Chrome keeps having the extra-tabs problem
(see #131)
  • Loading branch information
Chris White committed Aug 9, 2018
1 parent 36cb631 commit 8a0190f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tabfern/src/settings/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ If you're a developer, you can now load TabFern as a temporary add-on
and get at least the basic save/load/tab-switching. (Note that you can't
manipulate <tt>about:debugging</tt> because it's special to Firefox.)
${issue(100)}</li>
<li>There is now a "Reload" option on the menu
(${ham} ${gt} ${icon('fa fa-refresh')} Reload), in case TabFern
and Chrome get out of sync. ${issue(127)}</li>
<li>Bugfixes: ${issue(128,true)}</li>
</ul>`
},
Expand Down
21 changes: 21 additions & 0 deletions tabfern/src/view/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,14 @@ function connectChromeWindowToTreeWindowItem(cwin, existing_win, options = {})
}

// If we reach here, cwin.tabs.length === existing_win.node.children.length.

// TODO However, there may be other tabs not listed in cwin.
// Check the tabs in the window to make sure they match what we expect.
// See commit 70638829e5c35a8c86b556dc62ddb3920e4a5e92,
// at src/view/view.js:858. See also
// https://bugs.chromium.org/p/chromium/issues/detail?id=762951
// I am not sure how much of this can/should be done on the current tick.

for(let idx=0; idx < cwin.tabs.length; ++idx) {
let tab_node_id = existing_win.node.children[idx];
let tab_val = D.tabs.by_node_id(tab_node_id);
Expand Down Expand Up @@ -2418,6 +2426,12 @@ function hamAboutWindow()
K.openWindowForURL('https://cxw42.github.io/TabFern/');
} //hamAboutWindow()

/// Reload the TabFern window (or, at least, the tree iframe)
function hamReloadTree()
{
window.location.reload(true);
} //hamReloadTree()

/// Open the Settings window. If ShowWhatIsNew, also updates the K.LASTVER_KEY
/// information used by checkWhatIsNew().
function hamSettings()
Expand Down Expand Up @@ -2593,6 +2607,13 @@ function getHamburgerMenuItems(node, _unused_proxyfunc, e)
};
} //endif is_devel_mode

items.reloadItem = {
label: 'Reload',
action: hamReloadTree,
icon: 'fa fa-refresh',
separator_after: true,
};

items.infoItem = {
label: "Online info",
title: "The TabFern web site, with a basic usage guide and the credits",
Expand Down

0 comments on commit 8a0190f

Please sign in to comment.