Skip to content

Conversation

@jl4ever
Copy link
Contributor

@jl4ever jl4ever commented Nov 13, 2025

JIRA: https://procoretech.atlassian.net/browse/DMX-5787

Summary

This changeset is to help address the issue of having search result documentation pages in the iframe link back to github.io origin.

The changes are:

  1. Only sets when not in an iframe, so iframed pages navigate within the iframe instead of breaking out.
  2. Navigation links: Changed from relative URLs to absolute URLs using interpolated conditionals
  3. Gets the parent window's origin (ex: localhost:3000 or developers.procore.com) from ancestorOrigins or document.referrer so that there is no unfocused nav away into github.io source
  4. Rewrites navigation and content links to show the parent origin (localhost:3000 or developers.procore.com) on hover.
  5. Added rewriteSearchResultLinks() to rewrite search result links.
    a. use observer to add and rewrite search result links
    b. make sure navigation is always within the bound of the iframe for the search result rewritten links

Testing output from locally running dev-portal

  • Searched for a topic, highlighted url shows localhost:3000 [local dev-portal] (not localhost:4000 <-- running jekyll server)
Screenshot 2025-11-12 at 3 32 14 PM
  • Clicked on the link and it navigates to the right documentation page
Screenshot 2025-11-12 at 4 48 08 PM

@jl4ever jl4ever force-pushed the jj-poc-eval-search-no-longer-anchor-destination-web-url branch from e9b9bf3 to 1760c86 Compare November 13, 2025 02:08
@jl4ever jl4ever changed the title [DMX-5787] Fix documentation pages redirect to github.io from a search result link [DMX-5787] Search resultant linked pages should not redirect to github.io Nov 13, 2025
@jl4ever jl4ever requested a review from a team November 14, 2025 18:47
m-graf
m-graf previously approved these changes Nov 14, 2025
Copy link

@m-graf m-graf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loooks good!!

fix url schema check issue

Add proper console err for catch error blocks
@jl4ever jl4ever force-pushed the jj-poc-eval-search-no-longer-anchor-destination-web-url branch from 1760c86 to fe8e8db Compare November 14, 2025 19:59
@jl4ever jl4ever requested a review from m-graf November 14, 2025 21:56
@jl4ever jl4ever merged commit 2002ef7 into main Nov 14, 2025
5 checks passed
@jl4ever jl4ever deleted the jj-poc-eval-search-no-longer-anchor-destination-web-url branch November 14, 2025 22:19
@jl4ever jl4ever changed the title [DMX-5787] Search resultant linked pages should not redirect to github.io [DMX-5787][DMX-5788] Search resultant linked pages should not redirect to github.io Nov 14, 2025
jl4ever added a commit that referenced this pull request Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants