Skip to content

Commit bc5ad70

Browse files
committed
Updating .NET getPageSource implementation to match W3C spec
1 parent 4e7489e commit bc5ad70

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

dotnet/src/webdriver/Remote/RemoteWebDriver.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,8 @@ public string PageSource
225225
get
226226
{
227227
string pageSource = string.Empty;
228-
if (this.IsSpecificationCompliant)
229-
{
230-
string script = "var source = document.documentElement.outerHTML; \n"
231-
+ "if (!source) { source = new XMLSerializer().serializeToString(document); }\n"
232-
+ "return source;";
233-
pageSource = this.ExecuteScript(script).ToString();
234-
}
235-
else
236-
{
237-
Response commandResponse = this.Execute(DriverCommand.GetPageSource, null);
238-
pageSource = commandResponse.Value.ToString();
239-
}
240-
228+
Response commandResponse = this.Execute(DriverCommand.GetPageSource, null);
229+
pageSource = commandResponse.Value.ToString();
241230
return pageSource;
242231
}
243232
}

0 commit comments

Comments
 (0)