aboutsummaryrefslogtreecommitdiff
path: root/files/pt-pt/web/html/attributes/crossorigin
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 14:50:24 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 14:50:24 +0100
commit2c2df5ea01eb5cd8b9ea226b2869337e59c5fe3e (patch)
tree86ab4534d10092b293d4b7ab169fe1a8a2421bfa /files/pt-pt/web/html/attributes/crossorigin
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-2c2df5ea01eb5cd8b9ea226b2869337e59c5fe3e.tar.gz
translated-content-2c2df5ea01eb5cd8b9ea226b2869337e59c5fe3e.tar.bz2
translated-content-2c2df5ea01eb5cd8b9ea226b2869337e59c5fe3e.zip
unslug pt-pt: move
Diffstat (limited to 'files/pt-pt/web/html/attributes/crossorigin')
-rw-r--r--files/pt-pt/web/html/attributes/crossorigin/index.html87
1 files changed, 87 insertions, 0 deletions
diff --git a/files/pt-pt/web/html/attributes/crossorigin/index.html b/files/pt-pt/web/html/attributes/crossorigin/index.html
new file mode 100644
index 0000000000..42f32f77e8
--- /dev/null
+++ b/files/pt-pt/web/html/attributes/crossorigin/index.html
@@ -0,0 +1,87 @@
+---
+title: 'Atributo CORS: Solicitar acesso CORS para o conteúdo'
+slug: Web/HTML/CORS_settings_attributes
+tags:
+ - Avançado
+ - CORS
+ - HTML
+ - Precisa de Exemplo
+ - Referencia
+ - Segurança
+translation_of: Web/HTML/Attributes/crossorigin
+---
+<p><span class="seoSummary">In HTML5, some HTML elements which provide support for <a href="/en-US/docs/Web/HTTP/CORS">CORS</a>, such as {{ HTMLElement("img") }}, {{ HTMLElement("video") }} or {{ HTMLElement("script") }}, have a <code>crossorigin</code> attribute (<code>crossOrigin</code> property), which lets you configure the CORS requests for the element's fetched data.</span> These attributes are enumerated, and have the following possible values:</p>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <td class="header">Keyword</td>
+ <td class="header">Description</td>
+ </tr>
+ <tr>
+ <td><code>anonymous</code></td>
+ <td>CORS requests for this element will have the credentials flag set to 'same-origin'.</td>
+ </tr>
+ <tr>
+ <td><code>use-credentials</code></td>
+ <td>CORS requests for this element will have the credentials flag set to 'include'.</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>By default (that is, when the attribute is not specified), CORS is not used at all. The "anonymous" keyword means that there will be no exchange of <strong>user credentials</strong> via cookies, client-side SSL certificates or HTTP authentication as described in the <a class="external" href="http://www.w3.org/TR/cors/#user-credentials">Terminology section of the CORS specification</a>, unless it is in the same origin.</p>
+
+<p>An invalid keyword and an empty string will be handled as the <code>anonymous</code> keyword.</p>
+
+<h3 id="Exemplo_crossorigin_with_the_script_element">Exemplo: crossorigin with the script element</h3>
+
+<p>You can use the following {{HTMLElement("script")}} element to tell a browser to execute the <code>https://example.com/example-framework.js</code> script without sending user-credentials.</p>
+
+<pre class="brush: html">&lt;script src="https://example.com/example-framework.js"
+ crossorigin="anonymous"&gt;&lt;/script&gt;</pre>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Estado</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'infrastructure.html#cors-settings-attributes', 'CORS settings attributes')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'embedded-content.html#attr-img-crossorigin', 'crossorigin')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2>
+
+<h3 id="&lt;script_crossorigin>">&lt;script crossorigin&gt;</h3>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("html.elements.script.crossorigin")}}</p>
+
+<h3 id="&lt;video_crossorigin>">&lt;video crossorigin&gt;</h3>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("html.elements.video.crossorigin")}}</p>
+
+<h2 id="Consulte_também">Consulte também</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/HTTP/CORS">Cross-Origin Resource Sharing (CORS)</a></li>
+</ul>
+
+<div>{{QuickLinksWithSubpages("/en-US/docs/Web/HTML/")}}</div>