mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.14k stars 1.52k forks source link

Is Referer field supported by webdriver/geckodriver #2069

Closed prRZ5F4LXZ closed 1 year ago

prRZ5F4LXZ commented 1 year ago

https://www.w3.org/TR/webdriver1/#dfn-navigate-to

I don't see a way to specific the Referer header in the above endpoint according to webdriver standard. As such, my understanding is that geckodriver doesn't support this feature either. Is it so?

System

Testcase

NA

Stacktrace

NA

Trace-level log

NA

whimboo commented 1 year ago

The WebDriver classic specification can be found at https://w3c.github.io/webdriver/. The link you gave is outdated.

Nevertheless I'm not sure what you are referring to here. Nothing in the spec actually says that a referrer header is actually supported. Could you please give more details? Thanks.

prRZ5F4LXZ commented 1 year ago

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer

Firefox can send a request with the Referer field. I want to mimic this behavior.

As you said the webdriver spec does not mention a way to specify Referer. Therefore, I think there is no way to send a request with Referer specified. Since geckodrive conforms with the webdriver standard, I don't think geckodrive supports it either. I just want to confirm whether this is the case.

whimboo commented 1 year ago

Yes, it's also not a feature that is planned for the WebDriver classic specification. But there will be an API for network interception for WebDriver BiDi. So that will allow you to do that.

prRZ5F4LXZ commented 1 year ago

Just to be sure. You said "will". So the referer feature is still not available in BiDi?

whimboo commented 1 year ago

Correct. See the issue that I have referenced in my last comment.