chromium / content_analysis_sdk

This repository contains the SDK that DLP agents may use to become service providers for the Google Chrome Content Analysis Connector.
BSD 3-Clause "New" or "Revised" License
28 stars 19 forks source link

Multiple DLP calls on Google Docs #106

Open gregstoll opened 2 weeks ago

gregstoll commented 2 weeks ago

Hi! I'm a software engineer working on Firefox to integrate this SDK so DLP agents can support Firefox as well as Chromium.

One thing I've noticed is that when copying text from a Google Doc and pasting into another Google Doc, there are multiple calls to get the clipboard contents with different formats, and each one triggers a request to be sent to the DLP agent. Since many of these calls are from Javascript, Firefox shows a busy dialog each time a request is sent, which can make for a jarring experience.

A way of working around this would be to send one DLP request with the whole contents of the clipboard, but the protocol only seems to support a single string being sent at a time.

Is there a recommended way of dealing with this?

For reference, when I copy text from a Google Doc and paste into a different Google Doc, here are the calls I'm seeing that trigger DLP requests:

nancy-lan-xiao commented 1 week ago

Hi Greg,

The current design of the sdk is that one user action may trigger multiple DLP requests and we use user_action_id and user_action_requests_count in analysis.proto to keep track of those requests.

In Chrome, we don't show dialog whenever a request is sent, instead the dialog is shown (code location):

  1. when the analysis duration is longer than 1 second.
  2. when the blocking mode is turned on
  3. when the analysis result is not success.

If it is possible, updating the browser dialog logic is the most straightforward solution, otherwise, you might have to branch off from the SDK with updated proto on both client and browser side.

Hope it helps, Nancy