forked from GoogleChrome/samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·32 lines (27 loc) · 1.06 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
feature_name: Event.isTrusted
chrome_version: 46
feature_id: 6461137440735232
---
<style>
#redButton {
border-color: #F44336;
background-color: #FFCDD2;
}
#greenButton {
border-color: #4CAF50;
background-color: #C8E6C9;
}
</style>
<p>The <code>isTrusted</code> read-only property of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Event"><code>Event</code></a>
interface is a <code>Boolean</code> that is <code>true</code> when the event
was generated by a user action such as mouse click, and <code>false</code> when
the event was scripted or invoked via
<a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent"><code>dispatchEvent</code></a>.</p>
<p>This new property is intended primarily for use by browser extensions, to
determine if an event was dispatched by a script running in the main world or
not.</p>
<button id="greenButton">Generate Trusted Event</button>
<button id="redButton">Generate Untrusted Event</button>
{% include output_helper.html %}
{% include js_snippet.html filename='demo.js' %}