Firefox "not well formed" error on Gmail mobile site's search page

0

I use the Gmail Mobile site (not the smartphone version, but the old, lightweight, feature-phone-compatible one) on my desktop Firefox browser, via the set of URLs starting with https://mail.google.com/mail/u/0/x/. Recently (about 4-5 days ago), the email search page (which I had bookmarked as https://mail.google.com/mail/u/0/x/18ffn87o67mlt-/?&v=srch) began giving me this error:

XML Parsing Error: not well-formed
Location: https://mail.google.com/mail/u/0/x/1p6790md7rs8l-/?&v=srch
Line Number 6, Column 38:
for(i=0;i<searchButtonElements.length;i++)searchButtonElements[i].onclick=function(event){var urlParams={"s":"q","q":document.getElementById("sbq").value};urlParams[event.target.getAttribute("name")]=event.target.getAttribute("value");var encodedParams=[];for(var param in urlParams)encodedParams.push(encodeURIComponent(param)+"\x3d"+encodeURIComponent(urlParams[param]));document.getElementById("sbf").setAttribute("action","?"+encodedParams.join("\x26"))};
-------------------------------------^

If I check the source of the error page, the actual source of the Gmail Search page is shown.

I did not make any changes on my local Firefox installation/extensions/scripts. The error just came up suddenly.

Other pages of the same Gmail Mobile site are working fine. If I try to access the Search feature from any of those pages, I get the same error page as outlined above.

My question is, is there a way for configuring the Firefox XML parser (without rebuilding it from source :) ) in order to make it ignore the said error? (The error occurs inside a JavaScript fragment (surrounded by <script>...</script> tags), so in my opinion the XML parser should not even bother about it.)

Or else, is there a way to intercept the browser's resource loading process so that I can write a custom handler to modify (fix) the raw content of the page before it gets parsed by the parser?

Thanks in advance.

Janaka Bandara

Posted 2015-06-10T09:35:25.943

Reputation: 250

The error pointer (last line of the error message) is pointing to the second semicolon of line 4 (at the end of i<searchButtonElements.length;). Obviously the parser tries to process <searchButtonElements... as a new tag, although it's already inside a <script> tag pair. – Janaka Bandara – 2015-06-10T09:38:21.817

As a general rule, "not well formed" means that the markup document has flaws in its structure, like unclosed tags, closing tags with no start. attributes without quotes or with inconsistent quotes, etc. – Frank Thomas – 2015-06-10T12:22:26.597

@Frank sure, but in this case it appears that the parser is trying to parse a section of the document body that it is not supposed to parse; specifically the content within a <script>...</script> tag pair. Chrome, for example, loads the same page without any errors, indicating that it either does not try to parse the script fragment, or ignores the error as it does not affect the DOM generation. – Janaka Bandara – 2015-06-11T12:44:26.453

No answers