I’m integrating Collabora Online (read-only mode) into a React app via iframe. I’m trying to use the Linking API to navigate to a specific bookmark when the document loads.
According to the documentation:
You can open document at specific target by using additional URL parameter for example: &target=Table1|table
I have a DOCX file with a bookmark (visible in MS Word via Insert → Bookmark). According to extract-link-targets output, bookmarks are returned without a type suffix, just the name. So I’m passing &target=bookmarkName in the iframe URL.
What happens: The document opens normally, but there is no scrolling to the bookmark position. The viewport stays at the top of the document.
Questions:
Is &target= supposed to scroll the viewport to the target location, or does it do something else?
Does it work in read-only mode, or only in edit mode?
Is there a known issue with this feature? We couldn’t find any community discussion about it actually working.
We’ve already investigated Action_Find (highlights but doesn’t scroll), .uno:GoToPage (opens a dialog), and postMessage navigation — all dead ends per previous forum discussions.
Based on my analysis of the codebase, here’s what I found:
Yes, it’s supposed to, but there’s a bug/implementation issue. The code in browser/src/layer/tile/CanvasTileLayer.js sends .uno:OpenHyperlink with #targetName as the URL. However:
The documentation says to use format &target=Table1|table (with type suffix)
The code doesn’t actually parse the type suffix - it just prepends # to whatever you pass
The extract-link-targets API returns bookmarks without a type suffix (just the name)
This mismatch means bookmarks from extract-link-targets won’t work correctly with &target.
The code has no explicit read-only check that would prevent this from working. However, .uno:OpenHyperlink may behave differently in read-only mode.
Issue #10798 - Cannot create internal links to headers/index
Multiple forum posts about bookmark/jump functionality not working
The goToTarget() function uses .uno:OpenHyperlink, which is designed for hyperlinks within documents, not for navigating to bookmarks. This is fundamentally the wrong mechanism.
Workarounds you could try:
Use &target=bookmarkName|bookmark (add the |bookmark suffix) - though the code doesn’t parse it, it may help internally
Use the search parameter with highlight=true - this at least highlights text, though doesn’t scroll either