fix(api-explorer): resolve extension routes to absolute Looker host URLs#1735
Draft
Itzaprado wants to merge 1 commit into
Draft
fix(api-explorer): resolve extension routes to absolute Looker host URLs#1735Itzaprado wants to merge 1 commit into
Itzaprado wants to merge 1 commit into
Conversation
Fixes b/532671853 where right-clicking and opening links in new tabs inside Looker API Explorer extension opened sandboxed iframe URLs. Introduces `resolveRouteToAbsoluteUrl` method to environment adaptors. Updates the global `Link` component to render absolute URLs in `href` while intercepting left-clicks for internal routing in extension mode.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes b/532671853.
In Looker Extension mode, right-clicking a link and selecting "Open link in new tab" resolves the relative URL against the sandboxed iframe origin instead of the parent Looker host origin.
This PR:
resolveRouteToAbsoluteUrlmethod to environment adaptors (BrowserAdaptorandExtensionAdaptor).ExtensionAdaptorto construct absolute parent window URLs usinglookerHostData.Linkcomponent to render absolute URLs inhrefwhen running in Extension mode, while intercepting normal left-clicks to perform internal memory-routing.Linkwrapper instead ofreact-router-dom's defaultLink.