Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error page in Firefox #6

Open
jcoupey opened this issue Jul 5, 2016 · 11 comments
Open

Error page in Firefox #6

jcoupey opened this issue Jul 5, 2016 · 11 comments

Comments

@jcoupey
Copy link

jcoupey commented Jul 5, 2016

Thanks for making this available, it's exactly what I need to type simple markdown files!

I've installed flymd via melpa and I get the

If you see this page, you are so lucky.......

page upon M-x flymd-flyit. It does point to the browser.md file for solution but everything is supposed to be ok with Firefox.

My setting is Ubuntu 16.04, Emacs 24.5.1 and Firefox 47.0. Any hint on what I might try?

@mola-T
Copy link
Owner

mola-T commented Jul 7, 2016

Sorry for late reply
I am using a very similar config as yours Ubuntu 14.04, Emacs 24.5.1 and Firefox 47.0. And it is working fine.
If you see that error page under this situation, it should be because javascript cannot be loaded successfully.

You may need to check:

  1. whether you can access https://cdn.rawgit.com/mola-T/flymd/master/cdn/flymd_1_3_0.js where the javascript hosted
  2. whether you enabled javascript or is blocked by addon

M-x flymd-flyit should point to flymd.html

@jcoupey
Copy link
Author

jcoupey commented Jul 7, 2016

Thanks for your reply. Javascript is enabled on my side.

As you pointed out, there is a problem with getting the js files. When loading flymd.html, the network dev panel indicates a successful request to get https://code.jquery.com/jquery-2.2.3.min.js. But oddly, the other js and css mentioned in the html header are not loaded.

I can access the files manually though (e.g. showing https://cdn.rawgit.com/mola-T/flymd/master/cdn/flymd_1_3_0.js in the browser). And if I replace the links in flymd.html to point to a local copy of the js and css files, everything is working as expected!

@mola-T
Copy link
Owner

mola-T commented Jul 7, 2016

Is it all fies from domain rawgit.com cannot be loaded?

Does it help with Ctrl + f5 to reload all files?

@jcoupey
Copy link
Author

jcoupey commented Jul 7, 2016

Is it all fies from domain rawgit.com cannot be loaded?

Actually yes, the jquery file that is successfully loaded is the only one from another domain. Using Ctrl + f5 does not make any difference. What puzzles me is that from the firebug network panel, I don't get any error or failed attempt at downloading the files from rawgit.com.

@mola-T
Copy link
Owner

mola-T commented Jul 9, 2016

Does it work if you change the flymd.html <head> part to:

  <head>
    <!--- This is the css used by for displaying gfm. --->
    <!--- Source --->
    <!--- https://github.com/sindresorhus/github-markdown-css --->
    <link rel="stylesheet" href="https://raw.github.com/mola-T/flymd/master/cdn/github-markdown_1_0_0.css">
    <!--- My css file to format the page --->
    <link rel="stylesheet" href="https://raw.github.com/mola-T/flymd/master/cdn/flymd_1_1_0.css">
    <!--- jQuery --->
    <script src="https://code.jquery.com/jquery-2.2.3.min.js"
            integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo="
            crossorigin="anonymous"></script>
    <!--- This is the script for converting md to html --->
    <!--- Source --->
    <!--- https://github.com/showdownjs/showdown --->
    <script type="text/javascript"
            src="https://raw.github.com/showdownjs/showdown/master/dist/showdown.min.js"></script>
    <!--- My js file. --->
    <script type="text/javascript"
            src="https://raw.github.com/mola-T/flymd/master/cdn/flymd_1_3_0.js"></script>
  </head>

@jcoupey
Copy link
Author

jcoupey commented Jul 11, 2016

Thanks for your response. When replacing the header by the above code, the markdown input is normally rendered in html, and auto-refresh and auto-scroll work fine.

However, the firebug network panel indicates a 301 Moved Permanently status code for all files from raw.github.com and the css files are not downloaded properly, resulting in default html rendering.

I'm still able to get the expected rendering by linking to local copy of the css files, so I can use the mode nevertheless.

@mola-T
Copy link
Owner

mola-T commented Jul 12, 2016

Linking to local copy is a nice work around. However, you need to manually replace the code if this package updates or even stop the package from updating.

301 Moved Permanently is an error about redirection. I think you can still try changing raw.github.com to raw.githubusercontent.com. If this works, I can add a fallback css/js src.

This issue seems to be a special case. I will keep this issue opened for a month. If there is no further update or user report, I will close this after a month.

@jcoupey
Copy link
Author

jcoupey commented Jul 12, 2016

Switching all raw.github.com to raw.githubusercontent.com get the github markdown css to work, but I'm still missing the layout related to flymd_1_1_0.css. I agree this seems to be a very specific problem, so feel free to close this issue whenever you want. Thanks for your input on this.

However, the idea of having the files locally accessible might still be interesting. It would allow an offline use of the package which is impossible right now. Have you considered shipping the js/css files with the package?

@mola-T
Copy link
Owner

mola-T commented Jul 12, 2016

Local js/css is not preferred because it involved relative path.

Currently flymd.html is by default copied to the same directory of the markdown. It will be over complicated if js/css are also copied to the markdown directory (you know there is quite a lot js/css files).

@tareefdev
Copy link

tareefdev commented Oct 8, 2017

I have the same problem here.
My work environment: OpenSUSE 42.3, Firefox 56, Emacs 24.3.1
I tried to replace the <head> part in flymd.html and switched all raw.github.com to raw.githubusercontent.com but without any result

@seagle0128
Copy link

It does work with Firefox 57.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants