-
Notifications
You must be signed in to change notification settings - Fork 9
Forward Felt new window requests via IPC. #310
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
base: enterprise-main
Are you sure you want to change the base?
Conversation
Extend the URL opening IPC with a flag indicating where to open things.
0beecbc to
45fa1e2
Compare
Because we changed the message format.
1rneh
left a comment
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.
Thanks, overall the changes on the js side look good!
Two things I noticed:
- Most of these changes still need some
#ifdef MOZ_ENTERPRISE-ing. - The code that handles external links and requests new windows is very distributed. I think a new module that centralizes all that logic would help.
| export let gFeltPendingURLs = []; | ||
| const FELT_OPEN_DISPOSITION_DEFAULT = 0; | ||
| const FELT_OPEN_DISPOSITION_NEW_WINDOW = 1; | ||
| const FELT_OPEN_DISPOSITION_NEW_PRIVATE_WINDOW = 2; |
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.
Let's export these flags here and import them wherever needed (e.g. in browser/base/content/nonbrowser-mac.js and browser/extensions/felt/api.js). Maybe also wrap them in an enum?
export const FELT_OPEN_WINDOW_DISPOSITION = {
DEFAULT : 0,
NEW_WINDOW : 1,
NEW_PRIVATE_WINDOW : 2,
}
| // Make sure that when FeltUI is requested, we do not try to open another | ||
| // window. Instead, forward any URLs to be opened in the real Firefox. | ||
| if (Services.felt.isFeltUI()) { | ||
| if (isFeltUI) { |
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.
Could we delcare isFeltUI closer to its usage? Or actually, since it's only used once, we could generally drop the variable and call Services.felt.isFeltUI(); directly.
| ); | ||
| queueURL(payload); | ||
| } catch (err) { | ||
| gFeltPendingURLs.push(payload); |
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.
Maybe also leave a log message console.warn(`Retrying to queue url ${payload.url} after initial failure.`);
Extend the URL opening IPC with a flag indicating where to open things.