> For the complete documentation index, see [llms.txt](https://docs.admira.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.admira.com/english/contents/html-content/good-practices.md).

# Good Practices

{% hint style="warning" %}
**Important**

Exception handling should be used with try/catch. Unhandled exceptions could disable the HTML5 player in some of its functions. If errors occur that could harm the normal execution of the player, Admira will not be responsible for the consequences.
{% endhint %}

### Iframe

The execution of content or WebApps occurs within a sandboxed HTML \<iframe> TAG. This iframe sandbox contains the following permissions enabled:

* *allow-forms Re-enables form submission*
* *allow-pointer-lock Re-enables APIs*
* *allow-same-origin Allows the iframe content to be treated as being from the same origin*
* *allow-scripts Re-enables scripts*

By cons are not allowed:

* *top-navigation*; (esto es, solo se puede usar *“\_self”* en target de links)
* *popups*

### Access to external resources

Each case is different. In the case of wanting to access resources from other “sites”, the execution policies from an \<iframe> must be taken into account. This means that options like X-Frame-Options or CORS must be set correctly on the server we want to make the request to. In short, the WebApps that we want to run in admire \<iframe> do not run as in a browser, but in an “unattended window”.

### ASYNC requests

It is important to note that any request made either abroad (url on the internet) or locally (file on filesystem) must be done ASYNCHRONOUSLY, since the HTML content shares an execution THREAD with the player. Therefore, if a SYNC request were to occur, the player would stop until the request was finished. This can cause serious problems running player. Therefore, ALL requests must be made ASYNCHRONO, just as any execution of SYNCRONO blocking code must be avoided so that it does not cause an unusual stop to the player.

On this website we can simulate blocking of requests:

<http://slowwly.robertomurray.co.uk/delay/3000/url/http://api.admira.com>

Where 3000 is the delay in milliseconds.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.admira.com/english/contents/html-content/good-practices.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
