chrome.feedbackPrivate

Description: Use the chrome.feedbackPrivate API to provide Chrome [OS] feedback to the Google Feedback servers.
Availability: Since Chrome 29.
Permissions: "feedbackPrivate"

Implemention of the Chrome [OS] Feedback UI

The Chrome [OS] Feedback UI is invoked when the user clicks the Report an Issue button in the wrench->tools menu (wrench menu if on Chrome OS). This triggers the onFeedbackRequested event with a feedbackInfo object with the URL of the current page (determined by the active tab) and if available, the email of the logged in user filled in. On Chrome OS, the system information field in the feedbackInfo object may also contain relevent data (for example, as of now it is populated with a TIMESTAMP key containing the timestamp of when the user invoked feedback).

The UI first takes a screenshot, then displays itself. It uses the provided API's to get system information and provides the user with fields to fill out feedback.

Once the user is done, the UI uses the sendFeedback API to send the feedback to the feedback servers.

The sendFeedback API gathers the feedback data and starts a post to the feedback servers. If the post is successful, a 'success' status is returned to the Feedback UI, otherwise a 'delayed' status is returned and Chrome continues to try to send the feedback every 4 hours for up to a day.

Note: The feedbackPrivate API can also be used by particular apps to provide a custom feedback UI and send Chrome Feedback. The productId field in the feedbackInfo structure can be given to override the product ID to be sent with the feedback report. This will allow the app to send feedback to it's own feedback bucket instead of the default Chrome [OS] one.

Summary

Types
SystemInformation
FeedbackFlow
FeedbackInfo
Methods
getUserEmail chrome.feedbackPrivate.getUserEmail(function callback)
getSystemInformation chrome.feedbackPrivate.getSystemInformation(function callback)
sendFeedback chrome.feedbackPrivate.sendFeedback( FeedbackInfo feedback, function callback)
getStrings chrome.feedbackPrivate.getStrings( FeedbackFlow flow, function callback)
logSrtPromptResult chrome.feedbackPrivate.logSrtPromptResult(enum of "accepted", "declined", or "closed" result)
readLogSource chrome.feedbackPrivate.readLogSource(object params, function callback)
Events
onFeedbackRequested

Types

SystemInformation

properties
string key
string value

FeedbackFlow

Supported feedback flows.
Enum
"regular"
Flow for regular user. This is the default.
"login"
Flow on the ChromeOS login screen. URL entry, file attaching and landing page is disabled for this flow.
"showSrtPrompt"
Flow where a prompt to download the Chrome Cleanup Tool is displayed prior to showing the feedback form.
"sadTabCrash"
Flow when the feedback is requested from the sad tab ("Aw, Snap!") page when the renderer crashes.

FeedbackInfo

properties
object (optional) attachedFile

File to attach to the feedback report.

string name
Blob (optional) data
string (optional) categoryTag

An optional tag to label what type this feedback is.

string description

The feedback text describing the user issue.

string (optional) descriptionPlaceholder

Since Chrome 65.

The placeholder text that will be shown in the description field when it's empty.

string (optional) email

The e-mail of the user that initiated this feedback.

string (optional) pageUrl

The URL of the page that this issue was being experienced on.

integer (optional) productId

Optional product ID to override the Chrome [OS] product id that is usually passed to the feedback server.

Blob (optional) screenshot

Screenshot to send with this feedback.

integer (optional) traceId

Since Chrome 31.

Optional id for performance trace data that can be included in this report.

array of SystemInformation (optional) systemInformation

An array of key/value pairs providing system information for this feedback report.

boolean sendHistograms

Since Chrome 33.

True if we have permission to add histograms to this feedback report.

FeedbackFlow (optional) flow

Since Chrome 51.

Optional feedback UI flow. Default is the regular user flow.

string (optional) attachedFileBlobUuid

Since Chrome 32.

TODO(rkc): Remove these once we have bindings to send blobs to Chrome. Used internally to store the blob uuid after parameter customization.

string (optional) screenshotBlobUuid

Since Chrome 32.

boolean (optional) useSystemWindowFrame

Since Chrome 55.

Whether to use the system-provided window frame or custom frame controls.

Methods

getUserEmail

chrome.feedbackPrivate.getUserEmail(function callback)

Returns the email of the currently active or logged in user.

Parameters
function callback

The callback parameter should be a function that looks like this:

function(string email) {...};
string email

getSystemInformation

chrome.feedbackPrivate.getSystemInformation(function callback)

Returns the system information dictionary.

Parameters
function callback

The callback parameter should be a function that looks like this:

function(array of SystemInformation systemInformation) {...};
array of SystemInformation systemInformation

sendFeedback

chrome.feedbackPrivate.sendFeedback( FeedbackInfo feedback, function callback)

Sends a feedback report.

Parameters
FeedbackInfo feedback
function callback

The callback parameter should be a function that looks like this:

function(enum of "success", or "delayed" status) {...};
enum of "success", or "delayed" status

getStrings

chrome.feedbackPrivate.getStrings( FeedbackFlow flow, function callback)

Since Chrome 31.

Gets localized translated strings for feedback. It returns the strings as a dictionary mapping from string identifier to the translated string to use in the feedback app UI.

Parameters
FeedbackFlow flow

Since Chrome 60.

function callback

The callback parameter should be a function that looks like this:

function(object result) {...};
object result

logSrtPromptResult

chrome.feedbackPrivate.logSrtPromptResult(enum of "accepted", "declined", or "closed" result)

Since Chrome 52.

Logs whether the user accepted a prompt to try the Software Removal Tool.

Parameters
enum of "accepted", "declined", or "closed" result
accepted
User clicked the "Learn More" button.
declined
User declined the prompt and proceeded to the feedback page.
closed
User closed the window altogether.

readLogSource

chrome.feedbackPrivate.readLogSource(object params, function callback)

Since Chrome 61.

Reads from a log source indicated by source.

If incremental is false:

  • Returns the entire contents of the log file.
  • Returns readerId value of 0 to callback.
If incremental is true, and no readerId is provided:
  • Returns the entire contents of the log file.
  • Starts tracking the file read handle, which is returned as a nonzero readerId value in the callback.
  • If can't create a new file handle, returns readerId value of 0 in the callback.
If incremental is true, and a valid non-zero readerId is provided:
  • Returns new lines written to the file since the last time this function was called for the same file and readerId.
  • Returns the same readerId value to the callback.

Parameters
object params
enum of "messages", "uiLatest", "drmModetest", "lsusb", "atrusLog", "netLog", "eventLog", "updateEngineLog", "powerdLatest", "powerdPrevious", "lspci", "ifconfig", or "uptime" source

The log source from which to read.

messages
Chrome OS system messages.
uiLatest
Latest Chrome OS UI logs.
drmModetest
Info about display connectors and connected displays from DRM subsystem.
lsusb
USB device list and connectivity graph.
atrusLog
Logs from daemon for Atrus device.
netLog
Network log.
eventLog
Log of system events.
updateEngineLog
Update engine log.
powerdLatest
Log of the current power manager session.
powerdPrevious
Log of the previous power manager session.
lspci
Info about system PCI buses devices.
ifconfig
Info about system network interface.
uptime
Info about system uptime.
boolean incremental

For file-based log sources, read from source without closing the file handle. The next time readLogSource is called, the file read will continue where it left off. readLogSource can be called with incremental=true repeatedly. To subsequently close the file handle, pass in incremental=false.

integer (optional) readerId

To read from an existing file handle, set this to a valid readerId value that was returned from a previous readLogSource call. The reader must previously have been created for the same value of source. If no readerId is provided, readLogSource will attempt to open a new log source reader handle.

function callback

The callback parameter should be a function that looks like this:

function(object result) {...};
object result
integer readerId

The ID of the log source reader that was created to read from the log source. If the reader was destroyed at the end of a read by passing in incremental=false, this is always set to 0. If the call was to use an existing reader with an existing ID, this will be set to the same readerId that was passed into readLogSource.

array of string logLines

Each DOMString in this array represents one line of logging that was fetched from the log source.

Events

onFeedbackRequested

Fired when the a user requests the launch of the feedback UI. We're using an event for this versus using the override API since we want to be invoked, but not showing a UI, so the feedback extension can take a screenshot of the user's desktop.

addListener

chrome.feedbackPrivate.onFeedbackRequested.addListener(function callback)
Parameters
function callback

The callback parameter should be a function that looks like this:

function( FeedbackInfo feedback) {...};
FeedbackInfo feedback