Open Bug 1914409 Opened 11 months ago Updated 1 month ago

NS_BINDING_ABORTED error when navigating to a HTTP-only page and HTTPS-only mode enabled

Categories

(Remote Protocol :: WebDriver BiDi, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

(Whiteboard: [webdriver:backlog])

Attachments

(1 file)

(In reply to Christian Bromann from bug 1908515 comment #12)

I've created a reproduction case: https://github.com/christian-bromann/bidi-issue-ff .. just run npm install and then node test.js.

As it looks like this happens only for the first time I navigate to that page. Further navigation commands return success. To reproduce the following code can be run in the BiDi demo client:

(async function() {
    await sendCommand("session.new", { capabilities: {} });

    await sendCommand("session.subscribe", {"events":["log.entryAdded","browsingContext.contextCreated","browsingContext.contextDestroyed"]});
    await sendCommand("script.addPreloadScript", {"functionDeclaration":"function customElementWrapper() {\n    const origFn = customElements.define.bind(customElements);\n    customElements.define = function (name, Constructor, options) {\n        class WdioWrapperElement extends Constructor {\n            connectedCallback() {\n                super.connectedCallback && super.connectedCallback();\n                let parentNode = this;\n                while (parentNode.parentNode) {\n                    parentNode = parentNode.parentNode;\n                }\n                console.debug('[WDIO]', 'newShadowRoot', this, parentNode);\n            }\n            disconnectedCallback() {\n                super.disconnectedCallback && super.disconnectedCallback();\n                console.debug('[WDIO]', 'removeShadowRoot', this);\n            }\n        }\n        return origFn(name, WdioWrapperElement, options);\n    };\n}"});
  
    let res = await sendCommand("browsingContext.getTree", {});

    const context = res.result.contexts[0].context;
    await sendCommand("browsingContext.navigate", {
      context,
      url: "http://guinea-pig.webdriver.io/",
      wait: "complete"
    });

    // Do stuff ...
  })()

(In reply to Alexandra Borovova [:Sasha] from bug 1908515 comment #15)

I did a bit of testing and I think with the http://guinea-pig.webdriver.io/ page the issue is that it's http page, I've tried also a couple other pages (e.g. http://help.websiteos.com/websiteos/example_of_a_simple_html_page.htm) and they also triggered NS_BINDING_ABORTED error on the first navigation.

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

Ah, could this be maybe related to the HTTPS-only mode and that we are trying to forward to https://guinea-pig.webdriver.io/ but that is not available and we run into an error page.

Attached file BCWebProgress:5 log

As the log shows we seem to return early because of a STOP_STATE for about:home (which is the currently loaded page), and then we continue with loading the page:

1724337703839	RemoteAgent	TRACE	[4] NavigationListenerChild Loading state: flags: 131088, status: 2152398850,  isStart: false, isStop: true, isNetwork: false, isBindingAborted: true, targetURI: http://guinea-pig.webdriver.io/
1724337703839	RemoteAgent	TRACE	[4] NavigationListenerChild Loading state: flags: 983041, status: 0,  isStart: true, isStop: false, isNetwork: true, isBindingAborted: false, targetURI: http://guinea-pig.webdriver.io/
[Parent 14298: Main Thread]: I/BCWebProgress OnStateChange({isTopLevel:1, isLoadingDocument:1}, {URI:http://guinea-pig.webdriver.io/, originalURI:http://guinea-pig.webdriver.io/}, STATE_STOP|STATE_IS_NETWORK|STATE_IS_WINDOW, NS_BINDING_ABORTED) on {top:1, id:4, url:about:home}
1724337703844	RemoteAgent	TRACE	[4] ProgressListener Loading state: isStart=false isStop=true status=0x804b0002, loadType=0x200001
1724337703844	RemoteAgent	TRACE	[4] ProgressListener Stop: has error=true url=about:home
1724337703845	RemoteAgent	DEBUG	WebDriverBiDiConnection 75ef6ea6-8096-44f0-8ebb-192781f5912b <- {"type":"error","id":9,"error":"unknown error","message":"Error: NS_BINDING_ABORTED","stacktrace":"#checkLoadingState@chrome://remote/content/shared/Navigate.sys.mjs:328:28\nonStateChange@chrome://remote/content/shared/Navigate.sys.mjs:423:28\n"}
1724337703846	RemoteAgent	TRACE	[594297b9-cb22-483a-b9c4-38c8313b5596] Skipping already tracked navigation, navigationId: 35407337-ba06-40eb-8295-ee19c5dadab6

This issue is actually related to the HTTPS-only mode settings in Firefox. A workaround for now is to set the preference dom.security.https_only_mode_ever_enabled_pbm to true so that this behavior is limited to private browsing windows, which are by default not used.

We have to check how best we can handle such cases with WebDriver by using the WebProgress listener.

Priority: -- → P3
Summary: NS_BINDING_ABORTED error when navigating to http://guinea-pig.webdriver.io/ → NS_BINDING_ABORTED error when navigating to http://guinea-pig.webdriver.io/ due to HTTPS-only mode

As discussed internally lets set as backlog for M12 for now.

Severity: -- → S3
Whiteboard: [webdriver:m12]
Whiteboard: [webdriver:m12] → [webdriver:m13]
Whiteboard: [webdriver:m13] → [webdriver:m14]
Whiteboard: [webdriver:m14] → [webdriver:m15]
Depends on: 1930616
Whiteboard: [webdriver:m15] → [webdriver:backlog]

With the patch from bug 1930616 I can no longer see an issue with loading this page:

1745992612311	RemoteAgent	DEBUG	WebDriverBiDiConnection 177e26be-292d-4269-a3ff-30ec68fb1643 -> {"method":"browsingContext.navigate","params":{"context":"6e1d586a-eeaa-4868-b6ea-e4505d6086bf","url":"http://guinea-pig.webdriver.io/","wait":"complete"},"id":6}
1745992612312	RemoteAgent	TRACE	Received command browsingContext.navigate for destination ROOT
1745992612312	RemoteAgent	TRACE	Received command browsingContext._getBaseURL for destination WINDOW_GLOBAL
1745992612323	RemoteAgent	TRACE	Created MessageHandler WINDOW_GLOBAL for session d3b11815-be52-456c-8ec9-ed507cc84cbe
1745992612323	RemoteAgent	TRACE	Received command browsingContext._getBaseURL for destination WINDOW_GLOBAL
1745992612326	RemoteAgent	TRACE	[4] ProgressListener Start: expectNavigation=true resolveWhenStarted=false unloadTimeout=200 waitForExplicitStart=true
1745992612326	RemoteAgent	TRACE	[4] ProgressListener Skip setting the unload timer
1745992612327	RemoteAgent	TRACE	[4] WebProgressListenerChild Loading state: flags: 983041, status: 0,  isStart: true, isStop: false, isNetwork: true, isBindingAborted: false, targetURI: http://guinea-pig.webdriver.io/
1745992612328	RemoteAgent	TRACE	[6e1d586a-eeaa-4868-b6ea-e4505d6086bf] Navigation started for url: http://guinea-pig.webdriver.io/ (bf4b32f8-3f4f-4c41-a591-2cc676732b9b)
1745992612328	RemoteAgent	TRACE	[4] ProgressListener Loading state: isStart=true isStop=false status=0x0, loadType=0x200001
1745992612328	RemoteAgent	TRACE	[4] ProgressListener Started loading http://guinea-pig.webdriver.io/
1745992612456	RemoteAgent	TRACE	[4] WebProgressListenerChild Loading state: flags: 131088, status: 2152398850,  isStart: false, isStop: true, isNetwork: false, isBindingAborted: true, targetURI: http://guinea-pig.webdriver.io/
1745992612457	RemoteAgent	TRACE	MessageHandler WINDOW_GLOBAL for session d3b11815-be52-456c-8ec9-ed507cc84cbe is being destroyed
1745992612457	RemoteAgent	TRACE	Unregistered MessageHandler WINDOW_GLOBAL for session d3b11815-be52-456c-8ec9-ed507cc84cbe
1745992612463	RemoteAgent	TRACE	[4] WebProgressListenerChild Loading state: flags: 983041, status: 0,  isStart: true, isStop: false, isNetwork: true, isBindingAborted: false, targetURI: http://guinea-pig.webdriver.io/
1745992612463	RemoteAgent	TRACE	[6e1d586a-eeaa-4868-b6ea-e4505d6086bf] Skipping already tracked navigation, navigationId: bf4b32f8-3f4f-4c41-a591-2cc676732b9b
1745992612466	RemoteAgent	TRACE	[4] WebProgressListenerChild Loading state: flags: 196612, status: 0,  isStart: false, isStop: false, isNetwork: false, isBindingAborted: false, targetURI: http://guinea-pig.webdriver.io/
JavaScript warning: https://guinea-pig.webdriver.io/components/jquery/jquery.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
1745992612514	RemoteAgent	TRACE	[4] WebProgressListenerChild Loading state: flags: 131088, status: 0,  isStart: false, isStop: true, isNetwork: false, isBindingAborted: false, targetURI: http://guinea-pig.webdriver.io/
1745992612515	RemoteAgent	TRACE	[6e1d586a-eeaa-4868-b6ea-e4505d6086bf] Navigation finished for url: http://guinea-pig.webdriver.io/ (bf4b32f8-3f4f-4c41-a591-2cc676732b9b)
1745992612515	RemoteAgent	TRACE	[4] ProgressListener Loading state: isStart=false isStop=true status=0x0, loadType=0x200001
1745992612515	RemoteAgent	TRACE	[4] ProgressListener Stop: has error=false url=https://guinea-pig.webdriver.io/
1745992612516	RemoteAgent	DEBUG	WebDriverBiDiConnection 177e26be-292d-4269-a3ff-30ec68fb1643 <- {"type":"success","id":6,"result":{"navigation":"bf4b32f8-3f4f-4c41-a591-2cc676732b9b","url":"https://guinea-pig.webdriver.io/"}}

Julian, I assume there is nothing else needed / planned so that we can close this bug as fixed?

Flags: needinfo?(jdescottes)

My patch should not have fixed anything here since the new behavior is behind a preference. I rolled back to the changeset before my patch and there is no error either. So something probably changed before that ?

Also the error originated from the Navigate helper, and not from the navigation manager.

The main difference is that we no longer get the early stop ProgressListener Loading state: isStart=false isStop=true status=0x804b0002, loadType=0x200001 for about:home, but that must be something which changed on the platform side?

Flags: needinfo?(jdescottes)

Ah right. Good point. One other option could be as well that the page itself changed. I might be good to check if we can still reproduce in an earlier version of Firefox (around the time when the bug got reported), and if yes to check when it was fixed.

I also cannot reproduce this failure anymore with older Firefox releases. Now I wonder if this test page was actually http-only and the server didn't offer it via HTTPS. When running the test now I can see an upgrade to HTTPS. Christian has something changed?

Flags: needinfo?(github)
Depends on: 1964369

Redirect a needinfo that is pending on an inactive user to the triage owner.
:whimboo, since the bug has recent activity, could you please find another way to get the information or close the bug as INCOMPLETE if it is not actionable?

For more information, please visit BugBot documentation.

Flags: needinfo?(github) → needinfo?(hskupin)

So this is basically related to the navigation to HTTP-only sites which are not getting upgraded with HTTPS-only mode enabled. I was able to find http://google.com/generate_204 as example which shows this error.

Julian, this problem seems to be still present with the navigation manager now running in the parent process.

Flags: needinfo?(hskupin)
Summary: NS_BINDING_ABORTED error when navigating to http://guinea-pig.webdriver.io/ due to HTTPS-only mode → NS_BINDING_ABORTED error when navigating to a HTTP-only page and HTTPS-only mode enabled

Julian, this problem seems to be still present with the navigation manager now running in the parent process.

To be clear, switching to the parent process navigation manager is not supposed to fix those errors, but it should allow us to observe NS_BINDING_ABORTED only when it's actually relevant. I will try to revive the patches from Bug 1914407, hopefully with the parent process navigation manager we should no longer have false positives.

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

Attachment

General

Created:
Updated:
Size: