GPII-4410: Opening BYOB web links in an existing tab.#202
Open
stegru wants to merge 9 commits intoGPII:masterfrom
Open
GPII-4410: Opening BYOB web links in an existing tab.#202stegru wants to merge 9 commits intoGPII:masterfrom
stegru wants to merge 9 commits intoGPII:masterfrom
Conversation
(cherry picked from commit 24a232e)
|
CI job failed: https://ci.gpii.net/job/gpii-app-tests/1146/ |
jobara
reviewed
May 28, 2020
| */ | ||
| fluid.defaults("gpii.app.linkRedirect", { | ||
| gradeNames: ["kettle.app"], | ||
| defaultRedirectUrl: "http://opensametab.morphic.org/redirect/$1", |
There was a problem hiding this comment.
I don't see where the "refreshsametab.morphic.org" urls are redirected. Is that in configuration somewhere?
Member
Author
There was a problem hiding this comment.
Yes, it's sort of in config.
See: https://github.com/GPII/gpii-app/pull/202/files#diff-713841a004bb552ae227e855846d4b04R34-R39
|
CI job failed: https://ci.gpii.net/job/gpii-app-tests/1149/ |
Member
|
13:10:55.709: FATAL ERROR: Uncaught exception: Assertion failure - check console for more details: Failed to resolve reference {gpii.app.linkRedirect}.options.defaultRedirectUrl |
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.
This turns links in the BYOB into a special url which a browser extension (https://github.com/GPII/gpii-open-same-tab-extension) will activate a tab if the link is already loaded. Otherwise, open a new tab like normal.
The urls will look like
http://opensametab.morphic.org/redirect/https%3A%2F%2Fexample.com.For times when the extension isn't installed (which can't easily be detected), things should still work. So,
opensametab.morphic.orgactually points to127.0.0.1so Morphic can listen for the request (with a/redirecthandler) and perform the redirect. Behind the scenes, the url will be modified so it accesses the correct port.Meaning, when an unconfigured browser tries to access the above url, the browser will still be redirected to
https://example.com.Requires GPII/gpii-open-same-tab-extension#2
To test: click on the
redditbutton - it should work with or without the browser extension.