diff --git a/README.md b/README.md index ff56bd0..e2a2059 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Once authorized, you'll see Timeline Viewer as a registered Google Drive viewer You can share this URL with any users who have both: 1. authorized [Timeline Viewer](https://chromedevtools.github.io/timeline-viewer/) to Drive via the typical Google OAuth flow and.. -1. have `Edit` permission to the Google Drive file +1. have `View` permission to the Google Drive file

- You can share this URL with any users who have both 1) authorized Timeline Viewer to Drive via the typical Google OAuth flow and 2) have Edit permission to the Google Drive file.
+
You can share this URL with any users who have both 1) authorized Timeline Viewer to Drive via the typical Google OAuth flow and 2) have View permission to the Google Drive file.
diff --git a/docs/storage.js b/docs/storage.js
index 78683c9..605a588 100644
--- a/docs/storage.js
+++ b/docs/storage.js
@@ -51,7 +51,7 @@ class GoogleDrive {
});
return new Promise(resolve => request.execute(resolve));
}
- insertPermission(fileId, type = 'anyone', role = 'writer') {
+ insertPermission(fileId, type = 'anyone', role = 'reader') {
const url = new URL(`https://www.googleapis.com/drive/v2/files/${fileId}/permissions`);
const body = {
role: role,
diff --git a/docs/timeline_viewer.js b/docs/timeline_viewer.js
index ef9eb8b..3502b2e 100755
--- a/docs/timeline_viewer.js
+++ b/docs/timeline_viewer.js
@@ -291,7 +291,7 @@ class Viewer {
this.makeDevToolsVisible(false);
const reasons = error.errors.map(e => e.reason);
let fileUnavailableStr = '';
- fileUnavailableStr += reasons.includes('notFound') ? 'Confirm you have Edit permissions to the file. ' : '';
+ fileUnavailableStr += reasons.includes('notFound') ? 'Confirm you have View permissions to the file. ' : '';
if (reasons.includes('authError')) {
fileUnavailableStr += 'Please sign in. ';
this.authBtn.hidden = false;
@@ -302,7 +302,7 @@ class Viewer {
if (!response.downloadUrl) {
this.makeDevToolsVisible(false);
- this.updateStatus('Downloading not available. Confirm you have Edit permissions to the file.');
+ this.updateStatus('Downloading not available. Confirm you have View permissions to the file.');
throw new Error(response.message, response.error);
}
@@ -374,6 +374,9 @@ class Viewer {
}
async uploadTimelineData() {
+ if (!window.confirm('Upload this trace to Google Drive? Anyone with the link will be able to view it.')) {
+ return;
+ }
const panel = await legacy.InspectorView.InspectorView.instance().panel('timeline');
// TODO: use proper saveToFile flow with better json formatting and its final tweaks to metadata.
this.uploadData(this.devTools.payload);