# Closing or Hiding the Plugin

## Closing the Plugin

To force the closing of the plugin window, use the `close()` method.  All requests to server and callback functions (except `on_close`) within the current session will be aborted.

Example:

```javascript
var session_id = 123;

OzLiveness.open({
  // We transfer the arbitrary meta data, by which we can later identify the session in Oz API
  meta: {
    session_id: session_id 
  },
  // After sending the data, forcibly close the plugin window and independently request the result
  on_submit: function() {
    OzLiveness.close();
    my_result_function(session_id);
  }
});
```

## Hiding the Plugin Window without Cancelling the Callbacks

To hide the plugin window without cancelling the requests for analysis results and user callback functions, call the `hide()` method. Use this method, for instance, if you want to display your own upload indicator after submitting data.

An example of usage:

```javascript
OzLiveness.open({
  // When receiving an intermediate result, hide the plugin window and show your own loading indicators
  on_result: function(result) {
    OzLiveness.hide();
    if (result.state === 'processing') {
      show_my_loader();
    }
  },
  on_complete: function() {
    hide_my_loader();
  }
});
```


---

# Agent Instructions: 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:

```
GET https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-liveness-websdk/web-plugin/closing-or-hiding-the-plugin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
