Is there a way to get the viewport offset used to see how far the user has scrolled down a page? I have seen it done by triggering the edit page event, that will make the sessionStorage.viewPort available. But it will also (of course) trigger an edit of the page which I do not want.
Any insights into this would be greatly appreciated, cheers!
i did not fully understand where you put the breakpoint.
i have two confluence instances running. 6.3.4 and 6.7.2. when i enter the editor of a long page, scroll down and reload the page, the scroll position is not restored (so it seems confluence does not store the scroll position on its own) - i am using chrome.
when i enter the editor (with my debug console open) and i try to read sessionStorage.viewPort i get “undefined”
when i scroll down in the editor, the value is still undefined.
is it possible that this value is written by some custom code or 3rd party plugin, or am i missing something?
I ended up doing some digging in the Confluence source code and found out that this is something that is done when activating the editor. TinyMCE uses it to scroll to the correct place on the page I think.
I guess what I could do is mimic the behaviour of that method instead of triggering the edit to get the position. We went for a slightly different solution in the end, but maybe I’ll get the time to revisit this soon.