The only way I found to get the settings from the contentScript is to:

  • create a contentScript plugin that does nothing
  • in the html rendered by the contentScript I call the webviewApi sending the content written inside the fence
  • the joplin plugin combines the content with the settings and replays with the new HTML that will replace the HTML that was calling the webviewApi

I had some problem figuring out how to call the webviewApi when the markdownIt page was rendered, but I finally managed to find a solution.

I use the event:

<style onload=" here the javascript to call the webviewApi" ></style>

I'm not sure this will help the plantuml plugin because it needs the settings to be accessed in the contentScript and not in the HTML rendered by the contentScript.

I hope this can help other plugin developers.
Let me know if you need more details.

1 Like