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

document.documentElement.innerText returns additional characters #3731

Closed
Lilyliu123 opened this issue Aug 22, 2023 · 2 comments
Closed

document.documentElement.innerText returns additional characters #3731

Lilyliu123 opened this issue Aug 22, 2023 · 2 comments
Labels
bug Something isn't working status-circle back Check back after requesting general information.

Comments

@Lilyliu123
Copy link

Lilyliu123 commented Aug 22, 2023

Description
document.documentElement.innerText returns additional at the beginning of the returned string.

Open url http://date.jsontest.com using edge.
Go to inspect->console, run document.documentElement.innerText

Expected result:
'{\n "date": "08-22-2023",\n "milliseconds_since_epoch": 1692669570858,\n "time": "01:59:30 AM"\n}\n'
Actual result:
'1\n2\n3\n4\n5\n{\n "date": "08-22-2023",\n "milliseconds_since_epoch": 1692668052676,\n "time": "01:34:12 AM"\n}'

A "12345" was added at the beginning of the string which seems like the number of the lines of innerText.

For example, the url http://echo.jsontest.com/key/value/one/two, document.documentElement.innerText returns below:
'1\n2\n3\n4\n{\n "one": "two",\n "key": "value"\n}'

Version
Runtime: 116.0.1938.54
OS: Windows 10

Regression
Was this working before but has regressed? Yes
If yes, what version did this last work on? Runtime: 115.0.1901.203

Repro Steps
Open url http://date.jsontest.com using edge.
Go to inspect->console, run document.documentElement.innerText

Additional context
We got the issue first with our c# code:
CoreWebView2.ExecuteScriptAsync("JSON.parse(document.documentElement.innerText)").
The additional characters in the returned string broke the json format.

@Lilyliu123 Lilyliu123 added the bug Something isn't working label Aug 22, 2023
@Lilyliu123
Copy link
Author

Could be a duplicate issue with #3560 . Will close the case once confirmed the solution provided in the case #3560 works for us.

@novac42 novac42 added the status-circle back Check back after requesting general information. label Aug 22, 2023
@Lilyliu123
Copy link
Author

Closed the issue because it is duplicated with #3560 and the alternative solution posted in it worked for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status-circle back Check back after requesting general information.
Projects
None yet
Development

No branches or pull requests

2 participants