markdown-viewer icon indicating copy to clipboard operation
markdown-viewer copied to clipboard

file:// URLs in Firefox 74 not rendered anymore

Open bidspells opened this issue 5 years ago • 5 comments
trafficstars

Dear all,

I observed that a markdown file provided by a file:// URL is not rendered anymore in Firefox 74 (macOS). Instead a dialog appears to either save the file or open it with an external program.

As I'm using this extension to view only local markdown files this new behavior is a kind of show stopper.

Best regards, Erik

bidspells avatar Apr 02 '20 12:04 bidspells

That's interesting because file:// URLs aren't even supported on Firefox. No idea what changed on FF 74, but you can check out this https://github.com/simov/markdown-viewer/issues/90#issuecomment-592962363 on how accessing file:// URLs behaves on other operating systems.

We have no information as of now about whether Markdown Viewer works for file:// URLs on FF and MacOS, so in case you can debug and figure this out, that would be really helpful.

simov avatar Apr 02 '20 19:04 simov

set markdown mime type as text/plain,firefox will open it. linux add it to ~/.mime.types

text/plain                                   md markdown

ywaby avatar May 09 '20 06:05 ywaby

It would be AWESOME to document this line xD

aemonge avatar Jun 03 '21 15:06 aemonge

Despite that, my system recognizes those files as text/markdown and firefox does not open them rendering the markdown. It shows them as text.

But this does not seem to be a firefox issue rather an issue of this specific extension. Other extensions meant to show markdown in firefox (e.g., markdown viewer webext) render the markdown just fine. Furthermore, weirdly enough, with the current extension, pressing the Reload current page button makes the markdown render properly (in some cases you need to press it more than once).

callegar avatar Jan 14 '22 10:01 callegar

Also if we are in linux we should

~/.local/share/mime/packages/text-markdown.xml

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="text/plain">
    <glob pattern="*.md"/>
    <glob pattern="*.mkd"/>
    <glob pattern="*.mkdn"/>
    <glob pattern="*.mdwn"/>
    <glob pattern="*.mdown"/>
    <glob pattern="*.markdown"/>
  </mime-type>
</mime-info>

Then run update-mime-database ~/.local/share/mime

aemonge avatar Feb 11 '22 11:02 aemonge

All of that was tested and validated by my in Markdown Viewer v5.1, make sure you have a look at the new screencast too. There is a new document dedicated to firefox related issues and their workarounds here. Let me know if you find any other issues.

simov avatar Mar 18 '23 09:03 simov