Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rob Wu <[email protected]>
  • Loading branch information
rebloor and Rob--W authored Sep 13, 2024
1 parent 09adf9d commit c488603
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A content script is a part of your extension that runs in the context of a web p

Just like the scripts loaded by normal web pages, content scripts can read and modify the content of their pages using the standard [Web APIs](/en-US/docs/Web/API). However, they can only do this when [host permissions to the web page's origin have been granted](#permissions).

> **Note:** The restriction on using specific Web API in [secure contexts](/en-US/docs/Web/Security/Secure_Contexts) only applies to their use in extensions, except that {{domxref("PointerEvent.getCoalescedEvents()")}} can be used from content scripts in all contexts.
> [!NOTE] Some specific Web APIs are restricted to [secure contexts](/en-US/docs/Web/Security/Secure_Contexts), which also applies to content scripts running in these contexts. Except for {{domxref("PointerEvent.getCoalescedEvents()")}}, which can be called from content scripts in insecure contexts in Firefox.
Content scripts can only access [a small subset of the WebExtension APIs](#webextension_apis), but they can [communicate with background scripts](#communicating_with_background_scripts) using a messaging system, and thereby indirectly access the WebExtension APIs.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/pointerevent/getcoalescedevents/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ page-type: web-api-instance-method
browser-compat: api.PointerEvent.getCoalescedEvents
---

{{APIRef("Pointer Events")}}

<div class='notecard secure'><h4>Secure context</h4><p> In web page scripts, this feature is available only in <a href='/en-US/docs/Web/Security/Secure_Contexts'>secure contexts</a> (HTTPS) in some or all <a href='#browser_compatibility'>supporting browsers</a>. In Firefox, when called from a web extension content script, this feature is available in all contexts.</p></div>
{{APIRef("Pointer Events")} {{securecontext_header}}

The **`getCoalescedEvents()`** method of the {{domxref("PointerEvent")}} interface returns a sequence of `PointerEvent` instances that were coalesced (merged) into a single {{domxref('Element/pointermove_event', 'pointermove')}} or {{domxref('Element/pointerrawupdate_event', 'pointerrawupdate')}} event.
Instead of a stream of many {{domxref('Element/pointermove_event', 'pointermove')}} events, user agents coalesce multiple updates into a single event.
Expand Down

0 comments on commit c488603

Please sign in to comment.