Plugin API Reference Documentation: Appendix II: Plugin code execution environment

linkPlugin API Reference Documentation: Appendix II: Plugin code execution environment

Plugin code is executed in a sandboxed iFrame, preventing direct access to the outer page/application. In the native mobile applications, plugin iFrames are loaded inside an isolated (hidden) WebView, with each plugin iFrame providing isolation from any other plugins that may be loaded.


Plugin code is executed in the user's browser on web and in the system WebView on mobile, so it's worth keeping browser compatibility in mind. There are no polyfills applied in the plugin code sandbox, nor is any processing performed on plugin code.


linkEmbed environment

Embed's operate in further separated iFrames, with some additional functionality defined on the window:


linkwindow.callAmplenotePlugin

Calls the onEmbedCall action in the plugin, passing the arguments that are passed to callAmplenotePlugin. Returns a promise that will resolve to whatever is returned by the plugin's onEmbedCall function, or undefined if nothing is returned.


linkwindow.setAmplenoteEmbedHeight

Sets a pixel based height for the embed iframe. This overrides the aspect-ratio based height, keeping the iframe at 100% width and this height. Can be called repeatedly, and must be called with a number greater than zero.