How to handler events on Reader Mode page in Edge?

Paul Tarkhoff 0 Reputation points
2024-05-05T08:38:10.17+00:00

I'm writing an extension for edge, and I need to handle text selection in my typescript application. But the thing is that I can't listen to standard page events like "mouseup", "selectionchange" in reader mode.

That is, this code will write a message to the console on a normal page. But nothing happens on the reader mode page.

document.addEventListener("mouseup", () => {
      console.log("Mouse up event");
    });

What events and how can I use in my code to handle mouse click or selection change in reader mod?

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,162 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yu Zhou-MSFT 12,371 Reputation points Microsoft Vendor
    2024-05-06T06:26:13.8133333+00:00

    Hi @Paul Tarkhoff

    I can reproduce it in Edge. I guess that's because Reader Mode is designed to provide a simplified reading experience, which may restrict certain interactions. But I also test on Chrome and Firefox reader mode and the page events will be fired.

    I think it's by design in Edge and there's no way to handle the events on Edge reader mode for now. I suggest that you can request a new feature to Edge team by pressing Alt+Shift+I in Edge.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Regards,

    Yu Zhou

    0 comments No comments