Qeole / Enlight

Firefox add-on providing syntax highlighting for raw code, based on the highlight.js project.
Mozilla Public License 2.0
44 stars 2 forks source link

Duet 2 Firmware #15

Closed Nachowarrior closed 4 years ago

Nachowarrior commented 5 years ago

Does not recognize G-code on duet 2 wifi/ethernet web interface. firmware 2.03.

Qeole commented 5 years ago

To be honest, I have no what this refers to. Are you sure this is the project you were looking for?

Nachowarrior commented 5 years ago

yes. duet 2 is a cnc microcontroller. it has a web interface that displays gcode. your plugin does not highlight any of the code. im trying to use the firefox addon.

On Tue, Sep 10, 2019, 7:49 PM Qeole notifications@github.com wrote:

To be honest, I have no what this refers to. Are you sure this is the project you were looking for?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Qeole/Enlight/issues/15?email_source=notifications&email_token=ANEZBDMCVCZCJ5X7NIQWYF3QJAW7JA5CNFSM4IVJ2GB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6M2HMA#issuecomment-530162608, or mute the thread https://github.com/notifications/unsubscribe-auth/ANEZBDIZEGBR4H5DISTZVOTQJAW7JANCNFSM4IVJ2GBQ .

Qeole commented 5 years ago

Oh, understood, sorry and thanks for the explanations.

Could you please check and confirm the following:

Nachowarrior commented 5 years ago

I am attaching the page source and a screenshot of the code in question with the add-on enabled. It is standard http. It does have an option to secure the page with a password. And yes, i believe it is loading from a .g or .gcode file. It is not a web page, but is displayed within the web page. So, I am not really sure how that works. :-D

this is the firmware/software in question: https://duet3d.dozuki.com/c/DuetWebControl

Hope this helps. I, and I assume many others in the 3d printing community, would love to have highlighted syntax right in the web control application. :-D

On Sat, Sep 14, 2019 at 12:23 PM Qeole notifications@github.com wrote:

Oh, understood, sorry and thanks for the explanations.

Could you please check and confirm the following:

  • Is the code displayed a non-HTML text file? (Just plain text file, with no ,
    , or whatever HTML markup could be produced by
    the web interface?)
  • Does the web server use a Content-Security-Policy: header in the HTTP reply? Asking because this is a known reason https://github.com/Qeole/Enlight/issues/8 why the add-on fails to work on pages from some servers. By the way, is this just auto-highlight that doesn't work, or does manual language selection fail as well?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Qeole/Enlight/issues/15?email_source=notifications&email_token=ANEZBDPD2GXEHKC5LYBNLPLQJUFWXA5CNFSM4IVJ2GB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6W7AYA#issuecomment-531492960, or mute the thread https://github.com/notifications/unsubscribe-auth/ANEZBDMRNXCXVZP7B4BHODDQJUFWXANCNFSM4IVJ2GBQ .

Qeole commented 5 years ago

The CSP header is something you get as part as the HTTP reply. On Firefox, I would typically find it with the “developer tools” (network tab - to open before file loads, then in the response headers for the code file).

Thanks for sending the source and screenshots; but I'm sorry, it looks like the attachements didn't make it to the GitHub interface (and I don't see them in email notification either). Would you have a chance to send them again, maybe directly on the GitHub interface, please?

Nachowarrior commented 5 years ago

oops. posted it over on your other thread. I didn't cehck before i posted it. Sorry. :-D

Qeole commented 5 years ago

No worries. Copying your picture here for the record:

foo

Source for the page

Qeole commented 5 years ago

Based on your picture, I'm not sure what we can do. The code is not highlighted because, obviously, the whole page itself is not just a raw text file, it's HTML with a box in which your code is displayed.

We could imagine highlighting the code in the box, but then I see two other issues:

So I don't really see what I could do in your case :/. Did you try to contact the Duet 2 community instead to see if they would have a way to support colors in their interface?

Nachowarrior commented 5 years ago

heard. i appreciate looking into it.

thanks.

On Sat, Sep 14, 2019, 3:58 PM Qeole notifications@github.com wrote:

Based on your picture, I'm not sure what we can do. The code is not highlighted because, obviously, the whole page itself is not just a raw text file, it's HTML with a box in which your code is displayed.

We could imagine highlighting the code in the box, but then I see two other issues:

-

The G-code displayed in the box is not part of the HTML source, I didn't explore the page in details but I would guess it is loaded from some Javascript code. Which means we would need to have to wait for that code to load in that specific text box before injecting the script for injection. That might work, but there's no way that would fit in a generic add-on, that would be very specific to that web interface.

Furthermore it looks like the box support editing the file, not just displaying it. Because syntax highlighting works by adding HTML markup with classes related to the different colors to the text, I would be concerned that modifying the text with the add-on may modify the code which is saved in your application when you hit “Save Changes”.

So I don't really see what I could do in your case :/. Did you try to contact the Duet 2 community instead to see if they would have a way to support colors in their interface?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Qeole/Enlight/issues/15?email_source=notifications&email_token=ANEZBDLXZDL2OXQOOIVT2VDQJU7ADA5CNFSM4IVJ2GB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6XC5SI#issuecomment-531508937, or mute the thread https://github.com/notifications/unsubscribe-auth/ANEZBDK4RWFGTQTAXGP7EADQJU7ADANCNFSM4IVJ2GBQ .