RESOLVED FIXED 196109
Web Inspector: Timelines - Cannot export on about:blank - suggested filename containing a colon silently fails
https://bugs.webkit.org/show_bug.cgi?id=196109
Summary Web Inspector: Timelines - Cannot export on about:blank - suggested filename ...
Joseph Pecoraro
Reported 2019-03-21 13:15:48 PDT
Timelines - Cannot export on about:blank - suggested containing a colon silently fails Steps to Reproduce: 1. Inspect about:blank 2. Start and stop a timeline recording 3. Click "Export" => Nothing happens Notes: - Changing the suggested filename from "about:blank-recording.json" to "about-blank-recording.json" works
Attachments
[PATCH] Proposed Fix (21.21 KB, patch)
2019-03-21 15:09 PDT, Joseph Pecoraro
timothy: review+
Joseph Pecoraro
Comment 1 2019-03-21 13:18:21 PDT
Switching from `encodeURI(filename)` to `encodeURIComponent(filename)` does get things working however "about:blank-recording.json" becomes "about/blank-recording.json" on macOS. So maybe we should sanitize this differently to be nicer.
Joseph Pecoraro
Comment 2 2019-03-21 15:09:22 PDT
Created attachment 365623 [details] [PATCH] Proposed Fix Not sure if `inspectorURLForFilename` is the best name, open to suggestions.
Devin Rousso
Comment 3 2019-03-21 18:02:28 PDT
Comment on attachment 365623 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=365623&action=review > Source/WebInspectorUI/UserInterface/Debug/ProtocolTrace.js:55 > + let url = WI.FileUtilities.inspectorURLForFilename(filename); > + return {url, content: JSON.stringify(this._entries)}; NIT: put this on separate lines. ``` return { url: WI.FileUtilities.inspectorURLForFilename(filename), content: JSON.stringify(this._entries), }; ``` > Source/WebInspectorUI/UserInterface/Views/LogContentView.js:269 > + let url = WI.FileUtilities.inspectorURLForFilename("Console.txt"); > + return {url, content: this._formatMessagesAsData(false), forceSaveAs: true}; Ditto (>ProtocolTrace.js:54). > Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js:148 > + let url = WI.FileUtilities.inspectorURLForFilename("InspectorStyleSheet.css"); > + return {url, content: this._textEditor.string, forceSaveAs: true}; Ditto (>ProtocolTrace.js:54).
Devin Rousso
Comment 4 2019-03-21 23:24:32 PDT
Radar WebKit Bug Importer
Comment 5 2019-03-21 23:26:17 PDT
Note You need to log in before you can comment on or make changes to this bug.