Open michaelk83 opened 2 years ago
The mime-type does not always get picked up properly. Can you try the work-around number 2?
Point the helpers.private_mime_types_file
config value to a file you’ll create, e.g. /opt/firefox/mime.types
or the default ~/.mime.types
and then create that file with the following content:
type=text/plain exts=md,mkd,mkdn,mdwn,mdown,markdown, desc="Markdown document"
Same result with ~/.mime.types
. I don't think that it's a MIME issue, because the file does get loaded and displayed (as a text file). I'm not getting a download prompt. But the content is displayed as plain text, and not being formatted.
If I refresh the file with Web Developer Tools open, I get a "Error: An unexpected error occurred" in the console. But not sure how to debug this beyond that.
On the about:addons
page there’s a gear menu with a “debug add-ons” link, that opens a page with an “Inspect” button for each add-on. The console tab in the inspect window will filter any general issues about the add-on.
If the issue happens just on the page, which seems to be the case, there might be a hint as to where the error happens on the line with the error message (usually in file:line:column format), or a way to expand the message to see a full traceback of the error.
You could also try to deactivate the extensions from the add-on configuration page, by unticking all checkboxes.
Clicking Inspect on the Markdown Viewer opens a new dev-tools window which doesn't show anything, since there's no document loaded there. Loading or refreshing the .md file in another tab doesn't affect this window, and I don't see how to load the file there. There's a line near the top that says "about:blank", but it's not editable.
FWIW, the error that shows up in the regular dev tools console (in the same tab as the file) has "undefined" on the right. Is that where the file/line is supposed to be?
I've tried disabling all other extensions. It doesn't make any difference.
Loading or refreshing the .md file in another tab doesn't affect [the inspect] window, and I don't see how to load the file there.
Yes it’s basically showing errors for add-on background pages/threads − this add-on doesn’t have one − but also shows other general add-on errors, such as permissions etc. You might have seen a message in the console when reloading the page but nothing more.
FWIW, the error that shows up in the regular dev tools console (in the same tab as the file) has "undefined" on the right. Is that where the file/line is supposed to be?
Yes :(
Could you try the following options (should be in order of increasing effort):
<html><head>…</head><body><pre># the text file</pre></body></html>
where # the text file
is what you would see when opening the page as “view page source”. If it’s not exactly that, e.g. if there’s any <div>
in there, it might just be a CSS issue..txt
files. Here the permissions are file://*/*.txt
(instead of *://*/*.md
), so we might update our permissions if this test passes.about:addons
’ gear menu click “Debug add-ons” and from that page click “Load Temporary Add-on”manifest.json
fileHello World!
(the test passed) or the original contents of the file (the test failed) − in the case of the provided txt file the contents are Webextension failed loading!
file:///data/Michael/Docs/gitdocs/index.md
, also tested same path with test.md
and test.markdown
.<pre></pre>
stuff.if this fails we identified a FF regression.
I've meanwhile upgraded to FF 101, btw.
# Headline
text
Which produces the following HTML in the dev tools:
```html
<html><head><link rel="stylesheet" href="resource://content-accessible/plaintext.css"></head><body><pre># Headline
text
</pre></body></html>
test.txt
file.A couple more data points:
"file://*/*.md",
to the permissions
array in manifest.json
, or changing the "*://*/*.md",
line to "file://*/*.md",
and then reloading the temporary, didn't fix the issue for me.Thanks for checking. So to summarise:
This all means it’s a bug while rendering the file, but I must say it’s a little hard to debug like that, without being able to reproduce on my side and without any kind of backtrace.
I've tried starting from the minimal extension and gradually adding back parts of the full one. AFAICT, the error is in the get({'plugins': {}})
call. Which then prevents the chained calls from being executed. Don't know why it fails, though.
Ubuntu 20.04, Firefox 100.0 installed manually to
/opt/
from web download, Markdown Viewer Webext 1.8.1When I try to load a local .md file, the file loads and is displayed (no download dialog), but renders as plain text, and isn't formatted. Same result with any local .md file.
I've followed the instructions to configure the MIME type, except I used
/usr/local/share/
instead of~/.local/share/
. This is my MIME file:IIRC, it worked correctly on an earlier version of FF, back when I set it up. I haven't used it in a while, but now it's not working, as described.
I have uBlock Origin, but disabling it makes no difference. Disabling all other extensions also doesn't help.
Are there some FF settings that may be blocking the extension scripts? What can I do to debug this further?