Feed reader embedded web browser crashes after clicking <a href="javascript:void(0)">
Categories
(MailNews Core :: General, defect)
Tracking
(Not tracked)
People
(Reporter: kajoamaton, Unassigned)
Details
Steps to reproduce:
- Create and open a new profile in Thunderbird 128.8.0esr (64-bit).
- Open Account Settings by pressing alt (opens toolbar) -> t (Tools) -> s (Account Settings).
- Click Account Actions -> Add Feed Account.
- In the Feed Account Wizard, click Next -> Finish to create a new feed account.
- Press ctrl-1 to go to the "main tab" of Thunderbird.
- Open feed subscriptions by pressing alt -> f (File) -> b (Subscribe).
- In Feed URL, enter https://old.reddit.com/r/all/.rss (or any feed where the webpage has <a href="javascript:void(0)"> elements).
- Click Add to create a new feed.
- Click the newly created feed folder. This shows a list of feed items in the message list pane.
- Double click one of the feed items to open it in a new tab.
- Press alt -> v (View) -> b (Feed Message Body As) -> w (Web Page) to open the feed item's URL in an embedded web browser.
- Scroll down to a Reddit comment and click the [-] button, which is supposed to minimize the comment. (Reddit implements this with an <a href="javascript:void(0)" onclick=...>)
- Observe that the embedded browser disappears. Inspecting it with the browser toolbox shows an empty <browser> element with no children.
I also tested this in the main tab's message pane. Its embedded browser will crash similarly.
I also tested this with other webpages by opening the embedded browser, selecting it with the browser toolbox and running the following JS commands from the toolbox. This will similarly crash the embedded browser.
const a = document.createElement("a");
a.href = "javascript:void(0)";
a.textContent = "test";
$0.appendChild(a); // When the embedded browser's <body> is selected in the browser toolbox inspector, $0 refers to the <body>
a.click();
Actual results:
- All content in the embedded web browser disappears.
- If these actions were performed in the message pane, no new embedded browser is opened in the message pane when selecting other feed items or when toggling the message pane with F8. Trying to open feed items from other folders causes the entire message pane to show up as empty.
- Inspecting the embedded web browser through browser toolbox only shows a <browser> element with no children.
Expected results:
Similarly to Firefox, clicking a <a href="javascript:void(0)"> should do nothing.
Reporter | ||
Comment 1•5 months ago
|
||
Furthermore, I used the browser toolbox to track the issue into the function StrictLinkClickHandlerChild.handleEvent (LinkClickHandlerChild.sys.mjs). By default, the click event goes through this function with all the if-branches evaluating to false. The embedded web browser doesn't crash if the following actions are performed:
- Add a breakpoint in StrictLinkClickHandlerChild.handleEvent.
- Click an anchor <a href="javascript:void(0)"> to trip the breakpoint.
- In the console, enter
event.preventDefault()
to stop the click event from propagating. - Click Resume (F8) to continue execution.
It seems to me that StrictLinkClickHandlerChild.handleEvent should have some added handling, such as if (eventUri.schemeIs("javascript")) event.preventDefault();
Comment 2•5 months ago
|
||
This was the cause of bug 1907115 which is now fixed.
Description
•