Issues with the Asciidoctor preview extension

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Issues with the Asciidoctor preview extension

xcoulon
Hello,

It looks like the Asciidoctor.js preview extension for Firefox and Chrome causes the following issues:
- on Firefox, it seems to hang the content assist in the location bar (the problem disappears when the extension is disabled)
- on Chrome, th add-on conflicts with the LiveReload extension: the asciidoctor add-on renders the HTML output from the given asciidoc resource, but then the <script> tag that should be inserted by the LiveReload extension is missing, which means that the LiveReload feature does not work after the first refresh..

Anyone seen that before ?

Thanks
Best regards,
Reply | Threaded
Open this post in threaded view
|

Re: Issues with the Asciidoctor preview extension

mojavelinux
Administrator
On Fri, Oct 4, 2013 at 4:00 AM, xcoulon [via Asciidoctor :: Discussion] <[hidden email]> wrote:

It looks like the Asciidoctor.js preview extension for Firefox and Chrome causes the following issues:
- on Firefox, it seems to hang the content assist in the location bar (the problem disappears when the extension is disabled)

This seems to be an extensions bug in Firefox that the Asciidoctor.js extension is unlucky enough to trigger. We've been discussing it here:

 
- on Chrome, th add-on conflicts with the LiveReload extension: the asciidoctor add-on renders the HTML output from the given asciidoc resource, but then the <script> tag that should be inserted by the LiveReload extension is missing, which means that the LiveReload feature does not work after the first refresh..

If I understand correctly, you are attempting to use the LiveReload feature with the rendered output from the Asciidoctor.js extension? I believe that is something Guillaume is looking into. I recommend filing an issue in asciidoctor-chrome-extension to make sure it's on the roadmap.
 
-Dan

--
Reply | Threaded
Open this post in threaded view
|

Re: Issues with the Asciidoctor preview extension

xcoulon
mojavelinux wrote
On Fri, Oct 4, 2013 at 4:00 AM, xcoulon [via Asciidoctor :: Discussion] <
[hidden email]> wrote:

>
> It looks like the Asciidoctor.js preview extension for Firefox and Chrome
> causes the following issues:
> - on Firefox, it seems to hang the content assist in the location bar (the
> problem disappears when the extension is disabled)
>

This seems to be an extensions bug in Firefox that the Asciidoctor.js
extension is unlucky enough to trigger. We've been discussing it here:

https://github.com/asciidoctor/asciidoctor-firefox-addon/issues/2
Thanks ! I missed that issue.

mojavelinux wrote
> - on Chrome, th add-on conflicts with the LiveReload extension: the
> asciidoctor add-on renders the HTML output from the given asciidoc
> resource, but then the <script> tag that should be inserted by the
> LiveReload extension is missing, which means that the LiveReload feature
> does not work after the first refresh..
>

If I understand correctly, you are attempting to use the LiveReload feature
with the rendered output from the Asciidoctor.js extension? I believe that
is something Guillaume is looking into. I recommend filing an issue in
asciidoctor-chrome-extension to make sure it's on the roadmap.
Yes, exactly ! We have a LiveReload support integrated in JBoss Tools, and starting in next version (JBossTools 4.1.1.Alpha2), user can edit Asciidoctor in JBoss Tools and when she saves, the embedded LiveReload plugin will notify the browsers that they should refresh the file. But since the <script> that loads the livereload.js is missing in the page, the browsers are not connected anymore and thus, they cannot received the lastest 'refresh' commands from our Eclipse plugin.

I opened https://github.com/asciidoctor/asciidoctor-chrome-extension/issues/8 to track that problem.

Best regards,
Xavier
Reply | Threaded
Open this post in threaded view
|

Re: Issues with the Asciidoctor preview extension

ggrossetie
xcoulon wrote
Yes, exactly ! We have a LiveReload support integrated in JBoss Tools, and starting in next version (JBossTools 4.1.1.Alpha2), user can edit Asciidoctor in JBoss Tools and when she saves, the embedded LiveReload plugin will notify the browsers that they should refresh the file. But since the <script> that loads the livereload.js is missing in the page, the browsers are not connected anymore and thus, they cannot received the lastest 'refresh' commands from our Eclipse plugin.
Yes, the extension replaces the entire body with the generated html :/
I added live reload to the extension but maybe that not what you wanted ?

xcoulon wrote
on Firefox, it seems to hang the content assist in the location bar (the problem disappears when the extension is disabled)
I posted on the Firefox forum but nobody seems to know why. You can try Firefox 24 on Linux/Windows or the Nightly build.
I will look again this week-end to see If I missed something...
Reply | Threaded
Open this post in threaded view
|

Re: Issues with the Asciidoctor preview extension

xcoulon

Best regards,
/Xavier



On Oct 5, 2013, at 1:26 AM, ggrossetie [via Asciidoctor :: Discussion] wrote:

xcoulon wrote
Yes, exactly ! We have a LiveReload support integrated in JBoss Tools, and starting in next version (JBossTools 4.1.1.Alpha2), user can edit Asciidoctor in JBoss Tools and when she saves, the embedded LiveReload plugin will notify the browsers that they should refresh the file. But since the <script> that loads the livereload.js is missing in the page, the browsers are not connected anymore and thus, they cannot received the lastest 'refresh' commands from our Eclipse plugin.
Yes, the extension replaces the entire body with the generated html :/
I added live reload to the extension but maybe that not what you wanted ?


What do you mean by "I added live reload to the extension" ? the LiveReload extension uses WebSockets to receive notifications from the server-side (in our case, JBoss Tools) and trigger a page reload (or CSS reload, which is not relevant in our case). Is it what you did ?


xcoulon wrote
on Firefox, it seems to hang the content assist in the location bar (the problem disappears when the extension is disabled)
I posted on the Firefox forum but nobody seems to know why. You can try Firefox 24 on Linux/Windows or the Nightly build.
I will look again this week-end to see If I missed something...

I'm on FF24 on MacOSX. Is there any pointer to dev tools I could use to try to debug that ? I haven't tried building FF extensions before.

Thanks
Best regards,
Xavier



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Issues-with-the-Asciidoctor-preview-extension-tp696p711.html
To unsubscribe from Issues with the Asciidoctor preview extension, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Issues with the Asciidoctor preview extension

ggrossetie
xcoulon wrote
What do you mean by "I added live reload to the extension" ? the LiveReload extension uses WebSockets to receive notifications from the server-side (in our case, JBoss Tools) and trigger a page reload (or CSS reload, which is not relevant in our case). Is it what you did ?
I didn't add LiveReload but a live reload feature. I use the setInterval function to refresh the content every 2 seconds if the content (md5sum) has changed.

xcoulon wrote
I'm on FF24 on MacOSX. Is there any pointer to dev tools I could use to try to debug that ? I haven't tried building FF extensions before.
I tried to debug with FF24 but without success. You can read the Mozilla documentation to set up your environment : https://developer.mozilla.org/en-US/docs/Setting_up_extension_development_environment

With the nightly build the debug works as expected (Web Console : https://developer.mozilla.org/en-US/docs/Tools/Web_Console)

Cheers,
Guillaume.
Reply | Threaded
Open this post in threaded view
|

Re: Issues with the Asciidoctor preview extension

ggrossetie
In reply to this post by xcoulon
I pushed some changes to preserve <script> in the body. I hope this will solve your issue ?
https://github.com/asciidoctor/asciidoctor-chrome-extension/commit/a314b789bccce8ecde57e3a04a7c4a56effe1d52

I also add a basic mechanism to detect LiveReload.js to avoid multiple refreshes. Although LiveReload only monitors files with specific extensions and *.ad, *.adoc, *.asc or *.asciidoc are not on that list :(


Guillaume.