-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPII-4410: Opening BYOB web links in an existing tab. #202
base: master
Are you sure you want to change the base?
Conversation
(cherry picked from commit 24a232e)
CI job failed: https://ci.gpii.net/job/gpii-app-tests/1146/ |
*/ | ||
fluid.defaults("gpii.app.linkRedirect", { | ||
gradeNames: ["kettle.app"], | ||
defaultRedirectUrl: "http://opensametab.morphic.org/redirect/$1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where the "refreshsametab.morphic.org" urls are redirected. Is that in configuration somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/ |
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 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.org
actually points to127.0.0.1
so Morphic can listen for the request (with a/redirect
handler) 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
reddit
button - it should work with or without the browser extension.