Skip to content
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

Query is not included in Href propery of IHtmlAnchorElement #1037

Closed
vastar opened this issue Jan 23, 2022 · 1 comment
Closed

Query is not included in Href propery of IHtmlAnchorElement #1037

vastar opened this issue Jan 23, 2022 · 1 comment
Milestone

Comments

@vastar
Copy link

vastar commented Jan 23, 2022

Query part of the URL is not included in the result string when getting Href propery of IHtmlAnchorElement if the attribute is empty href='' or has a link to an element on the same page href='#section1' href='#'. Browsers include query when clicking on such links.

Example:

var ctx = BrowsingContext.New();
var url = "https://example.com/path?query=value";
var content = "<a href='#section1'></a>";
var document = await ctx.OpenAsync(x => x.Address(url).Content(content));
var a = document.QuerySelector<IHtmlAnchorElement>("a");
Debug.Assert(a.Href == "https://example.com/path?query=value#section1");

For now a.Href equals "https://example.com/path#section1" in this scenario

@FlorianRappl
Copy link
Contributor

Landed in devel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants