# WebView

**imToken'**&#x73; built-in WebView uses the platform's native kernel and is fully compatible with [MetaMask](https://docs.metamask.io/guide/), while also providing public APIs to help you improve your Web app. You can seamlessly migrate your DApp to the imToken WebView environment at any time, or refine your site to make it a better experience in the imToken app.

{% hint style="success" %}
*WebView* refers to the host environment where the DApp or Web App is running in the imToken application.
{% endhint %}

## Features

### About Providers

* Fully compatible with *MetaMask* and can directly migrate Ethereum DApps for use within the imToken application.
* Based on the [EIP-1102](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md) standard, all DApps must follow the *EIP-1102* standard in order to access account information and perform other operations.
* For full support of [EIP-3085](https://eips.ethereum.org/EIPS/eip-3085), please see the [RPC documentation](https://imtoken.gitbook.io/developers/products/webview/rpcs) to learn more.
* You can develop EOS DApps based on Scatter. Support `scatterjs-core` versions less than or equal to `2.3.8`.
* `web3.js` is **not** **injected**, please see the [release notes](https://imtoken.gitbook.io/developers/products/webview/release-changes) for details.
* Initialization of the Provider and other related operations can be found in the [RPC documentation](https://imtoken.gitbook.io/developers/products/webview/rpcs).

### Internationalization

If your application supports multiple languages by default, you can confirm the current language environment using: (choose one of them)

1. **Request header** - We set the `accept-language` HTTP request header of the URL request, the value depends on imToken App language, such as:

   `Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,*;q=0.6`.
2. **URL Query** - The page in the WebView will automatically carry the language parameters of the query: `https://ens.token.im/?locale=en-US` .
3. **SDK API** - Get the current language environment through the [SDK API](https://imtoken.gitbook.io/developers/products/sdk#getcurrentlanguage).

### Debug

You can add a query `___debug` to your DApp URL, it will inject a console panel into your page，you can find a `vConsole` button in the bottom right corner of the page, it will open a panel after click (Similar to chrome's debug panel).

```
https://ens.token.im/?___debug=1
https://ens.token.im/?myQuery=something&___debug=1
```

### DeepLink

If your Web application (or DApp) is running on a **mobile device**, it can be called and redirected to the imToken application via *DeepLink*, and can be used within the imToken application as well. Please refer to the [DeepLink documentation](https://imtoken.gitbook.io/developers/products/deep-linking) for details.

### Wallet Connect

If your Web application (Including DApp) is running on the **desktop or in an external browser** and it is not convenient to use *DeepLink* to call the imToken application, *Wallet Connect* can help you connect to the imToken application. To learn how to connect and communicate using *Wallet Connect*, please visit our [Wallet Connect section](https://imtoken.gitbook.io/developers/deep-linking#wallet-connect-support).

### Preload Options

While your Web application is loading, we provide a more elegant display solution to ensure that your application always has the best user experience. Read more in [Preload URL Options documentation](https://imtoken.gitbook.io/developers/products/webview/preload-url-options).

### SDK

`@consenlabs-fe/webview` is an open-source SDK to help you get a better experience within the *imToken* application, and you can use this SDK for deep customization and development of imToken WebView. Read the [SDK API documentation](https://imtoken.gitbook.io/developers/products/webview/sdk) to learn more.

### Ethereum RPCs

Please view all methods in the [RPC documentation](https://imtoken.gitbook.io/developers/products/webview/rpcs).

### How to determine the imToken environment

* You can detect the imToken browser by `!!window.imToken` or `window.ethereum.isImToken`, it returns true if the current browser is an imToken DApp browser.
* Use the [WebView SDK](https://imtoken.gitbook.io/developers/products/sdk#istokenenv) directly.

### How to start development

If you are not yet experienced in developing DApps, you can refer to our [guidelines](https://imtoken.gitbook.io/developers/products/webview/development-guide-for-imtoken-dapp) to try to get started.
