diff --git a/parser/htmlparser/nsExpatDriver.cpp b/parser/htmlparser/nsExpatDriver.cpp index f5804c70463e..8a23449e63ec 100644 --- a/parser/htmlparser/nsExpatDriver.cpp +++ b/parser/htmlparser/nsExpatDriver.cpp @@ -828,6 +828,10 @@ nsresult nsExpatDriver::HandleError() { nsPrintfCString("%u", code)}, mozilla::Telemetry::EventExtraEntry{ "location"_ns, nsPrintfCString("%u:%u", lineNumber, colNumber)}, + mozilla::Telemetry::EventExtraEntry{ + "last_line"_ns, NS_ConvertUTF16toUTF8(mLastLine)}, + mozilla::Telemetry::EventExtraEntry{ + "last_line_len"_ns, nsPrintfCString("%u", mLastLine.Length())}, }); mozilla::Telemetry::SetEventRecordingEnabled("ysod"_ns, true); diff --git a/parser/htmlparser/tests/mochitest/browser_ysod_telemetry.js b/parser/htmlparser/tests/mochitest/browser_ysod_telemetry.js index 331e453afc8b..5a709351e70a 100644 --- a/parser/htmlparser/tests/mochitest/browser_ysod_telemetry.js +++ b/parser/htmlparser/tests/mochitest/browser_ysod_telemetry.js @@ -30,7 +30,12 @@ add_task(async function test_popup_opened() { method: "shown", object: "ysod", value: PAGE_URL.substr(0, 80), - extra: { error_code: "11", location: "3:12" }, + extra: { + error_code: "11", + location: "3:12", + last_line: "