Cimbali / markdown-viewer

Markdown (.md) file viewer WebExtension for your browser.
Other
165 stars 28 forks source link

No longer working when opening file from browser after the 6th Sep '18 update #43

Closed roperi closed 6 years ago

roperi commented 6 years ago

I normally open my MD files searching in the filesystem from the browser (i.e. file:///path/to/filename.md). But after updating to the newest version released few hours ago this is not longer working. When I navigate within the browser to 'file:///path/to/filename.md' the file is displayed in its text form. In order to display it properly I need to press enter in the URL search bar.

EDIT: Firefox Quantum 63.0b3 (64-bit). Debian 9.

KeithLRobertson commented 6 years ago

Thank you for the report! I have confirmed this behavior in FF 62.0 (64-bit) on Windows. I hate to pass the buck, but let me explain what changed and why I see this as a Firefox bug. I have opened this issue as Bug 1489312 https://bugzilla.mozilla.org/show_bug.cgi?id=1489312

Previously the add-on requested FF to inject its content scripts for every single thing you browse to, for any site content or local file. Its content script checked the URL against a regular expression, and if it matched, the script loaded additional scripts dynamically. This is not standard practice.

I changed it to use the content_scripts.matches entry in the extension manifest to tell Firefox which extensions it matches. Firefox should then load the extension's content scripts when a matching URL is loaded. It's not doing that when you navigate to it from a directory listing as you described. This also affects the Asciidoctor.js Live Preview extension for the same reason.

Hopefully Mozilla will address the issue I opened. Until then, you'll have to hit Enter in the URL box as you described. I would rather not go back to Firefox activating the add-on (injecting its content scripts) on every document load.

roperi commented 6 years ago

Ok, @KeithLRobertson! I'll close the issue then. Thanks for your help!

PanderMusubi commented 5 years ago

Voting for https://bugzilla.mozilla.org/show_bug.cgi?id=1489312 can help speed things up.