simov / markdown-viewer

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

Firefox missing file:// Blank page #90

Closed vayulove closed 1 year ago

vayulove commented 5 years ago

Once in a while it works. Mostly it displays a blank page. I can't figure out the conditions that it will display my file as markdown. When I hit refresh there's a flash of the original text file.

This is on Firefox.

I have it working wonderfully on Chrome and Chrome beta

On those working versions, on the advanced settings page there is an origin set of "file://" I don't have that option on firefox. Also on Chrome there is an option within Chrome settings to allow local files. I don't know how to set it on Firefox.

So I can't use this extension on my main browser, Firefox.

simov commented 5 years ago

Local file:// URLs are not supported in Firefox, last time I checked it wasn't working. That's why this option is disabled in the Advanced Options page for the extension.

You can easily run a file server on localhost. Check out this short screencast if you haven't already https://www.youtube.com/watch?v=c7Lb_Y092ok

You can read more about the issue here https://github.com/simov/markdown-viewer/issues/54

vayulove commented 5 years ago

You can easily run a file server on localhost. Check out this short screencast if you haven't already https://www.youtube.com/watch?v=c7Lb_Y092ok

Thanks, that's good to know. Is there something I can to to Firefox or my system beside run the server? (I actually run a full time local server, but I use markdown files scatted around my filesystem as notes to myself. It's not practical to have to move them over to the server folders.

simov commented 5 years ago

I think there was some sort of fix related to modifying some Firefox files to change the mime type of the Markdown documents to plain/text or something like that. But I've never tried it.

I have this running for my home folder, so that it includes everything I work on. And then you can have a trigger in your editor to load the file in your browser with the correct URL.

vayulove commented 5 years ago

I have this running for my home folder

Thanks, that looks very interesting.

doneykoo commented 5 years ago

I tried the several extensions and found this 'GitLab Markdown Viewer' is working for local file scheme ( file:// ). (in firefox 68.0.1 windows 10)

warmsocks commented 4 years ago

'GitLab Markdown Viewer' works for file:/// URIs too for me also, in Firefox 69.0.1 on Mac OS X 10.11.6.

duongdominhchau commented 4 years ago

I am using Firefox Developer Edition version 74.0b7 and this extension correctly rendered my Markdown when I use file:///.

vayulove commented 4 years ago

Thanks for letting me know it's supposed to work. I hit refresh over and over on some refreshes it will display markdown, on some others, just a blank white page, and on some the unformated markdown source. It's regularly unreliable. When it is showing properly drawn markdown, another refresh will often go back to a blank white page. I'm on 69. I guess I'll try an update or maybe a fresh install.

simov commented 4 years ago

@vayulove update your Markdown Viewer extension to the latest version. The blank page issue should be fixed now. As for newer versions of Firefox serving markdown files properly on file:/// URLs, that would be great, and I'll check that myself too.

simov commented 4 years ago

@duongdominhchau can you share your Operation System as well. I just tried on FF Nightly 75.0a1 (2020-02-29) (64-bit) and it still doesn't work for file:// URLs on Linux (Ubuntu 18.04).

duongdominhchau commented 4 years ago

Here they are:

Extensions

Name: Default Bookmark Folder Version: 2.12.0 Enabled: true ID: default-bookmark-folder@gustiaux.com

Name: KeePassXC-Browser Version: 1.5.4 Enabled: true ID: keepassxc-browser@keepassxc.org

Name: Markdown Viewer Version: 3.8 Enabled: true ID: markdown-viewer@outofindex.com

Name: Personal Blocklist (not by Google) Version: 3.4.0 Enabled: true ID: personal_blocklist@wildsky.cc

Name: Search by Image on Google Version: 1.6 Enabled: true ID: {1d6267dd-4b37-459a-84da-a5d2580daa6a}

Name: uBlock Origin Version: 1.25.0 Enabled: true ID: uBlock0@raymondhill.net

Important Modified Preferences

accessibility.typeaheadfind.flashBar: 0 browser.cache.disk.amount_written: 143568 browser.cache.disk.capacity: 1048576 browser.cache.disk.filesystem_reported: 1 browser.contentblocking.category: standard browser.download.folderList: 2 browser.privatebrowsing.autostart: true browser.sessionstore.upgradeBackup.latestBuildID: 20191228115717 browser.startup.homepage: about:blank browser.startup.homepage_override.buildID: 20200228110326 browser.startup.homepage_override.mstone: 74.0 browser.urlbar.placeholderName: DuckDuckGo browser.urlbar.placeholderName.private: DuckDuckGo dom.push.userAgentID: bc14b1281c4a405f8f0bfb23510ab56f extensions.lastAppVersion: 74.0 font.internaluseonly.changed: true idle.lastDailyNotification: 1582974865 media.gmp-gmpopenh264.abi: x86_64-gcc3 media.gmp-gmpopenh264.lastUpdate: 1578133194 media.gmp-gmpopenh264.version: 1.8.1.1 media.gmp-manager.buildID: 20200228110326 media.gmp-manager.lastCheck: 1582945108 media.gmp.storage.version.observed: 1 network.dns.disablePrefetch: true network.http.speculative-parallel-limit: 0 network.predictor.cleaned-up: true network.predictor.enabled: false network.prefetch-next: false places.database.lastMaintenance: 1582877233 places.history.expiration.transient_current_max_pages: 112348 plugin.flash.lastmod_hi: 367 plugin.flash.lastmod_lo: -1536175928 print.print_bgcolor: false print.print_bgimages: true print.print_duplex: 0 print.print_evenpages: true print.print_footerleft: print.print_footerright: print.print_headerleft: print.print_headerright: print.print_margin_bottom: 0.5 print.print_margin_left: 0.5 print.print_margin_right: 0.5 print.print_margin_top: 0.5 print.print_oddpages: true print.print_orientation: 0 print.print_page_delay: 50 print.print_paper_data: 0 print.print_paper_height: 11.69 print.print_paper_name: iso_a4 print.print_paper_size_unit: 0 print.print_paper_width: 8.27 print.print_scaling: 1.00 print.print_shrink_to_fit: true print.print_to_file: false print.print_unwriteable_margin_bottom: 56 print.print_unwriteable_margin_left: 25 print.print_unwriteable_margin_right: 25 print.print_unwriteable_margin_top: 25 privacy.history.custom: true privacy.sanitize.pending: [{"id":"newtab-container","itemsToClear":[],"options":{}}] security.fileuri.strict_origin_policy: false security.remote_settings.crlite_filters.checked: 1582545787 security.remote_settings.intermediates.checked: 1582545787 security.sandbox.content.tempDirSuffix: e3c8a670-6196-4c6c-8027-2018edd7e370 security.sandbox.plugin.tempDirSuffix: 0e1423e2-2f23-4de2-b227-a06ec26cc743 security.tls.version.enable-deprecated: true services.sync.declinedEngines: signon.importedFromSqlite: true storage.vacuum.last.index: 1 storage.vacuum.last.places.sqlite: 1580815554

Important Locked Preferences

fission.autostart: false



Please let me know if you want any other informations. Currently I can't think of anything else relevant to include in this comment.
simov commented 4 years ago

Thanks @duongdominhchau! Your customization for text/plain is exactly what makes Firefox serve Markdown files instead of prompting for an application to open them. It's great to have it documented here!

Unfortunately Firefox does not support that by default. So I can't claim that Markdown Viewer renders local file URLs on Firefox.

Also I can't add this information to the readme, unless I have similar guide on how to make it work on Windows and MacOS.

duongdominhchau commented 4 years ago

I have just installed it on Firefox 73 running on Windows, worked without any modification on my system. It has the problem similar to @vayulove mentioned though, sometimes it show a blank page, sometimes it renders correctly. I said it is similar because I can't see it displayed raw Markdown, even after hundreds refresh, just either blank or fully rendered. On Arch I rarely see this problem, most of the time it just works.

simov commented 4 years ago

Thanks for the feedback! I have a Windows machine around, so I'll hook it up over the weekend and see what's going on :+1:

simov commented 4 years ago

Just checked latest Firefox stable on Windows 10 and it seems the operating system or the browser appends a .txt extension at the end of the markdown file like this:

file:///C:/Users/simov/Downloads/syntax.md.txt

And so that isn't being rendered at all on my end because the file URL entry is disabled for Firefox in the Advanced Options page, and I can't really update the Path Matching RegExp to match on txt as well.

So I'm really not sure how Firefox is picking this up on your end, but I'm definitely going to revisit the file URL support for Firefox.

duongdominhchau commented 4 years ago

I don't know but when I test this extension, I just install and open md file in Firefox, no configuration. At that time it can't even render md from http:// and https:// URL because I haven't configure it yet, but md using file:// URL is still displayed correctly.

simov commented 4 years ago

Does it have .txt appended on your end? Also which version of Windows do you use, is it 10?

duongdominhchau commented 4 years ago

It's Windows 10 updated about 5 months ago, I installed it to use Visual Studio for my assignment. My file doesn't have .txt at the end. How did you create the file? Did you forget to show the file extension on Windows, because by default Windows hides the real extension. I once forgot to turn off that "feature" of Windows.

simov commented 4 years ago

I downloaded it from here, but now I have to hook the entire machine back just to check if it was stored as syntax.md.txt or not ...

ywaby commented 4 years ago

still has problem with markdown viewer 3.9. and the more plugins, the higher the problem frequency

my env

debian stable
firefox esr
simov commented 1 year ago

Markdown Viewer v5.1 was released with lots of new features and bugfixes so make sure you check that out. Also there is a new screencast about it and a new documentation specific to Firefox issues and workarounds.

I'm closing this issue because it seems that it may contain a lot of inaccurate facts about the extension. For example one thing that I fixed in v5.1 was about Firefox showing a blank page when navigating back and forward between markdown documents.

Feel free to open up another issue if you find anything specific.