angular/aio/content/guide/browser-support.md
2023-11-08 08:49:28 -08:00

87 lines
2.8 KiB
Markdown

# Browser support
Angular supports most recent browsers.
This includes the following specific versions:
| Browser | Supported versions |
|:--- |:--- |
| Chrome | 2 most recent versions |
| Firefox | latest and extended support release \(ESR\) |
| Edge | 2 most recent major versions |
| Safari | 2 most recent major versions |
| iOS | 2 most recent major versions |
| Android | 2 most recent major versions |
<div class="alert is-helpful">
Angular's continuous integration process runs unit tests of the framework on all of these browsers for every pull request, using [Sauce Labs](https://saucelabs.com).
</div>
## Polyfills
The [Angular CLI](cli) provides support for polyfills.
When a new project is created, the CLI also creates an `src/polyfills.ts` file.
If your application requires any polyfills, you can add them to the `src/polyfills.ts` file.
If you are not using the CLI to create your projects, see [Polyfills for non-CLI users](#non-cli) section.
If you create a TypeScript file for a custom polyfill, make sure to include it in the `files` property of your `tsconfig` file.
<code-example language="jsonc" syntax="jsonc">
{
"extends": "./tsconfig.json",
"compilerOptions": {
...
},
"files": [
"src/main.ts",
"src/polyfills.ts"
]
...
}
</code-example>
<a id="non-cli"></a>
## Polyfills for non-CLI users
If you are not using the CLI, add your polyfill scripts directly to the host web page \(`index.html`\).
For example:
<code-example header="src/index.html" language="html">
&lt;!-- pre-zone polyfills --&gt;
&lt;script src="node_modules/core-js/client/shim.min.js"&gt;&lt;/script&gt;
&lt;script>
/**
&ast; you can configure some zone flags which can disable zone interception for some
&ast; asynchronous activities to improve startup performance - use these options only
&ast; if you know what you are doing as it could result in hard to trace down bugs.
*/
// &lowbar;&lowbar;Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// &lowbar;&lowbar;Zone_disable_on_property = true; // disable patch onProperty such as onclick
// &lowbar;&lowbar;zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
/*
&ast; in Edge developer tools, the addEventListener will also be wrapped by zone.js
&ast; with the following flag, it will bypass `zone.js` patch for Edge.
*/
// &lowbar;&lowbar;Zone_enable_cross_context_check = true;
&lt;/script&gt;
&lt;!-- zone.js required by Angular --&gt;
&lt;script src="node_modules/zone.js/bundles/zone.umd.js"&gt;&lt;/script&gt;
&lt;!-- application polyfills --&gt;
</code-example>
<!-- links -->
<!-- external links -->
<!-- end links -->
@reviewed 2022-11-04