aecreations / readnext

Read Next: an extension for Mozilla Firefox
Other
4 stars 1 forks source link

Can't open Reader Mode links #39

Closed aecreations closed 1 year ago

aecreations commented 1 year ago

Read Next 0.8.3+

Reading list links for pages that were displayed in Reader Mode won't open. The browser console reports the following error:

Uncaught (in promise) Error: Illegal URL: about:reader?url=https%3A%2F%2Fwww.example.com%2Fpath%2Fto%2Ffile.html
  open       moz-extension://e57ebd81-bab5-42bb-8e33-7108922d02de/pages/sidebar.js:20
  ...
aecreations commented 1 year ago

It is not possible to change an existing tab to use Reader Mode using browser.tabs.update(). Only new tabs can be opened in Reader Mode; see the documentation for browser.tabs.create()[1].

-- [1] https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/create

aecreations commented 1 year ago

I did manage to get links to open in Reader View. The problem is that the user is unable to switch out of it, because it causes the browser tab to reload, and the tab load event handler finds that the URL is already in the reading list and will then force Reader View.

For version 1.0, simply load the page as normal; user can turn on Reader View from the address bar if they want to.