simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.05k stars 133 forks source link

file:// URLs in Firefox 74 not rendered anymore #116

Closed bidspells closed 1 year ago

bidspells commented 4 years ago

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

simov commented 4 years ago

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.

ywaby commented 4 years ago

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

text/plain                                   md markdown
aemonge commented 3 years ago

It would be AWESOME to document this line xD

callegar commented 2 years ago

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).

aemonge commented 2 years ago

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

simov commented 1 year ago

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.