> For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt.

# disableAlertBeforeUnload

关闭页面返回前提醒。

## 扫码预览

![扫码预览 disableAlertBeforeUnload](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fui%252Falert-before-unload%252Findex)

## 支持版本

前端库版本不低于 `0.2.0`。

## 支持平台

<table>
<thead>
<tr><th>平台</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>Android</td><td>支持</td></tr>
<tr><td>iOS</td><td>支持</td></tr>
<tr><td>PC</td><td>不支持</td></tr>
<tr><td>HarmonyOS</td><td>不支持</td></tr>
</tbody>
</table>

## 接入准备

### 前置条件

- 必须在页面容器内调用

## 调用方式

### 异步 API

```typescript
disableAlertBeforeUnload(params?: object): Promise<object>
```

## 入参

无。

## 调用示例

```typescript
import { disableAlertBeforeUnload } from '@doubao-dev/framework/api';

await disableAlertBeforeUnload();
```

## 成功返回

无返回字段。

## 错误处理

错误对象和通用错误码见 [通用错误处理](/apps-plugin/docs/js-api/common-errors.md#错误返回)。

### 失败示例

```json
{
  "errNo": 103,
  "errMsg": "feature not support"
}
```

### 错误码

<table>
<thead>
<tr><th>errNo</th><th>errMsg</th><th>平台</th><th>触发条件</th><th>处理建议</th></tr>
</thead>
<tbody>
<tr><td><code>103</code></td><td><code>feature not support</code></td><td>Android、iOS</td><td>当前调用不来自页面容器</td><td>请在页面生命周期内调用。</td></tr>
</tbody>
</table>

#### 通用错误码

<table>
<thead>
<tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
</thead>
<tbody>
<tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android、iOS</td></tr>
</tbody>
</table>
