Skip to content

Conversation

@gcp
Copy link
Contributor

@gcp gcp commented Dec 26, 2025

Extend the URL opening IPC with a flag indicating where to open things.

Extend the URL opening IPC with a flag indicating where to open things.
Because we changed the message format.
Copy link
Contributor

@1rneh 1rneh left a 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;
Copy link
Contributor

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) {
Copy link
Contributor

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);
Copy link
Contributor

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.`);

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.

3 participants