Skip to content

Commit

Permalink
Do not update current URL when navigating items
Browse files Browse the repository at this point in the history
Closes #46
  • Loading branch information
qsantos committed Oct 16, 2024
1 parent 1de8554 commit 87d99e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Immediately scroll to corresponding item when navigating newest items #54
- Revert change from v0.1.26 that always put the active item at top of view in normal browsing
- Do not update current URL when navigating items to avoid polluting browser history #46

# v0.1.26

Expand Down
10 changes: 0 additions & 10 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -978,22 +978,12 @@ chrome.storage.sync.get((options) => {
}

function gotoTop() {
const l = document.location;
history.replaceState(null, "", l.pathname + l.search);
deactivateCurrentThing();
scrollTo(0, 0);
}

let historyUpdateTimer = null;
function gotoThing(thing) {
if (thing) {
// Defer history update to avoid too many uses of the API, when the
// user navigates through many things in a short amount of time
clearTimeout(historyUpdateTimer);
historyUpdateTimer = setTimeout(() => {
history.replaceState(null, "", `#${thing.id}`);
historyUpdateTimer = null;
}, 50);
// Immediately makes the change visible
if (
thing.classList.contains("comtr") ||
Expand Down

0 comments on commit 87d99e6

Please sign in to comment.