Skip to content

Commit da10b1a

Browse files
authored
Merge pull request #85 from solid/nss/1094-history-direct-link
Do not modify the History on direct links
2 parents c21a858 + 24ba81e commit da10b1a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

outline/manager.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,12 @@ module.exports = function (doc) {
16621662
UI.utils.getEyeFocus(tr, false, undefined, window) // instantly: false
16631663
}
16641664

1665-
if (solo && dom && dom.defaultView && dom.defaultView.history) {
1665+
if (
1666+
solo && dom && dom.defaultView && dom.defaultView.history
1667+
// Don't add the new location to the history if we arrived here through a direct link
1668+
// (i.e. when static/databrowser.html in node-solid-server called this method):
1669+
&& document.location.href !== subject.uri
1670+
) {
16661671
let stateObj = pane ? { paneName: pane.name } : {}
16671672
try { // can fail if different origin
16681673
dom.defaultView.history.pushState(stateObj, subject.uri, subject.uri)

0 commit comments

Comments
 (0)