Open Bug 1838158 Opened 1 years ago Updated 9 days ago

Warning logged when using "--remote-allow-origins" or "--remote-allow-hosts"

Categories

(Remote Protocol :: Agent, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned, Mentored)

References

Details

(Whiteboard: [lang=js])

Attachments

(1 file)

Passing those arguments to Firefox now results in a warning logged from https://searchfox.org/mozilla-central/rev/962a843f6d96283c45162c788dc72bf217fca7df/browser/components/BrowserContentHandler.sys.mjs#1245-1247

    for (let i = 0; i < cmdLine.length; ++i) {
      var curarg = cmdLine.getArgument(i);
      if (curarg.match(/^-/)) {
        console.error(
          "Warning: unrecognized command line flag " + curarg + "\n"
        );
        // To emulate the pre-nsICommandLine behavior, we ignore
        // the argument after an unrecognized flag.
        ++i;
      } else {
        try {
          urilist.push(resolveURIInternal(cmdLine, curarg));
        } catch (e) {
          console.error(
            "Error opening URI '" +
              curarg +
              "' from the command line: " +
              e +
              "\n"
          );
        }
      }
    }

remote-debugging-port is not impacted, probably because of the code at https://searchfox.org/mozilla-central/rev/962a843f6d96283c45162c788dc72bf217fca7df/remote/components/RemoteAgent.sys.mjs#172-181:

  handle(cmdLine) {
    // remote-debugging-port has to be consumed in nsICommandLineHandler:handle
    // to avoid issues on macos. See Marionette.jsm::handle() for more details.
    // TODO: remove after Bug 1724251 is fixed.
    try {
      cmdLine.handleFlagWithParam("remote-debugging-port", false);
    } catch (e) {
      cmdLine.handleFlag("remote-debugging-port", false);
    }
  }

Adding similar code for the other command line arguments silences the warnings, but it would be nice to know if we should do something to properly declare those arguments or if this is just another macos timing issue for processing command line arguments (similar to Bug 1724251)

Hi Dave, would it be enough to just use handleFlagWithParam() for our other command line flags or as Julian asked, do we have to register the arguments somewhere? Thanks!

Flags: needinfo?(dtownsend)

(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #1)

Hi Dave, would it be enough to just use handleFlagWithParam() for our other command line flags or as Julian asked, do we have to register the arguments somewhere? Thanks!

That is probably the easiest solution right now

Flags: needinfo?(dtownsend)

Thanks! Then we can do it that way.

I've also updated the summary of the bug so it refers to the correct arguments that we support for the Remote Agent.

Summary: Warning logged when using remote-debugging-origins or remote-debugging-hosts → Warning logged when using "--remote-allow-origins" or "--remote-allow-hosts"
Mentor: hskupin
Severity: -- → S3
Priority: -- → P3
Whiteboard: [lang=js]

cauasene00 will have a look at this bug as discussed on bug 1904310. Thank you for your interest.

Assignee: nobody → cauasene00
Status: NEW → ASSIGNED

Hi @cauasene00 I wanted to check back with you if you have issues updating the patch or just having less time to get it updated based on my review. Thanks!

Flags: needinfo?(cauasene00)

I'm going to unassign this bug for now given that we didn't hear from cauasene00 over the last month. I'm happy to re-assign in case we get a reply and there is interest in continue the contribution.

Assignee: cauasene00 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(cauasene00)

I am using Mozilla Firefox 132.0.2 on Ubuntu 24.04.1 and I am unable to reproduce this issue.

I have tried the following commands in my terminal, and am not seeing the logged warning mentioned in this ticket:

Am I not using the correct command when trying to reproduce this issue?

Thanks

The reason why you aren't seeing those failures is that by default these kind of logs are not printed to the console. Seeing you are commenting on this bug I assume you have an interest to contribute? If yes I would suggest that you first setup a clone of mozilla-central and get an artifact build of Firefox and then get it running via mach run. With the latter command you can then easily see the mentioned warnings in the console output.

See https://firefox-source-docs.mozilla.org/testing/marionette/NewContributors.html in how to get started.

Note that this might be a macos only issue. I haven't checked on other operating systems, but similar bug 1724251 is macos only.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: