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

On Firefox: diagrams feature enabled - fails #310

Closed
mbeckerle opened this issue Nov 6, 2019 · 10 comments · Fixed by #311
Closed

On Firefox: diagrams feature enabled - fails #310

mbeckerle opened this issue Nov 6, 2019 · 10 comments · Fixed by #311

Comments

@mbeckerle
Copy link

Version 2.3.0

Firefox version 70.0.1 (64-bit)

If I install as a firefox add-on/extension, then I enable the diagrams feature by checking the box in the preferences/settings for this extension. Then when I try to view an asciidoc page that has a diagram, I get "Error

ReferenceError : AsciidoctorKroki is not defined"

This same thing viewing the same file, works fine on Chrome.

ggrossetie added a commit to ggrossetie/asciidoctor-chrome-extension that referenced this issue Nov 6, 2019
- Upgrade to asciidoctor-kroki v0.3.0
** Catch all exceptions when reading a file (because Firefox does not allow to read file from file:// protocol for security reasons)
** Remove rusha from the bundle (because for whatever reason, it does not work on Firefox)
- Load kroki.js before the renderer.js (order matters on Firefox)
@ggrossetie
Copy link
Member

Hi @mbeckerle

I can reproduce this issue.
There were some specific issues with Firefox.
It should be fixed in #311

Could you please consider editing your review on the Firefox Add-ons ?
I don't think the extension deserves a 1/5 stars because a feature is not working at a given time on a specific browser: https://addons.mozilla.org/fr/firefox/addon/asciidoctorjs-live-preview/reviews/?score=1

Thanks

@mbeckerle
Copy link
Author

mbeckerle commented Nov 6, 2019 via email

@ggrossetie
Copy link
Member

Thanks for reconsidering your review 👍

I'm making sure it's working on Chrome and Opera as well. Hopefully I will release a new version at the end of this week.

ggrossetie added a commit that referenced this issue Nov 9, 2019
* resolves #310 fix Kroki on Firefox

- Upgrade to asciidoctor-kroki v0.3.0
** Catch all exceptions when reading a file (because Firefox does not allow to read file from file:// protocol for security reasons)
** Remove rusha from the bundle (because for whatever reason, it does not work on Firefox)
- Load kroki.js before the renderer.js (order matters on Firefox)

* Upgrade Kroki extension to 0.4.0

* Forcibly remove the kroki-fetch-diagram attribute

Because this feature is not supported in a browser environment.
@ggrossetie
Copy link
Member

I've published a new version 2.3.1.
Once it's approved by the Firefox team it will be available on https://addons.mozilla.org/

If you don't want to wait, you can install the xpi:

install-file

  • Select the xpi file
  • Enable Kroki from the extension options
  • Enjoy!

enjoy

Please note that for security reasons the following syntax does not work on Firefox:

plantuml::components.puml[]

See: #302

@ggrossetie
Copy link
Member

Version 2.3.1 is now available on the Firefox Add-ons website: https://addons.mozilla.org/firefox/addon/asciidoctorjs-live-preview/

@mbeckerle Could you please confirm that this issue is fixed?

@mbeckerle
Copy link
Author

Alas does not work for me. I installed, checked the box in preferences for allowing diagrams. Then view a file URL of an asciidoc file I have with diagrams in it. I get:

Error
ReferenceError : AsciidoctorKroki is not defined

@ggrossetie
Copy link
Member

Are you sure that you are using the latest version?
Could you please go to about:addons and check the version:

version

You might need to click "Check for Updates" and "Install update".

@mbeckerle
Copy link
Author

It says version 2.3.1.

@mbeckerle
Copy link
Author

Ah, a restart of Firefox, and now it is working.

@ggrossetie
Copy link
Member

Great 👌

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

Successfully merging a pull request may close this issue.

2 participants