asciidoctor/asciidoctor-browser-extension

how to Add custom JavaScript - before the document has been rendered ?

qwertysk opened this issue · 1 comments

Pls, what is the correct way to do that ?

I want to replace/remove some parts using regex - before adoc is rendered - something like preprocessor ...

image

image

Hello,

It's currently not possible to register Asciidoctor.js extension since the code is running in the background script.
This feature will run JavaScript in the context of web pages (client-side) before or after the HTML document has been rendered.

As far as I know, it's not possible to load user-provided code in the background script/context... one idea (I just had) would be to send a message to the background script/context and use eval to load the code but that's not pretty and potentially unsecure/harmful!

If you want to track progress on this new feature, please open a formal proposal for this feature.

In the future, please ask usage questions in the project chat at chat.asciidoctor.org. We don't use the issue tracker as a support forum.