| Summary: | Web Inspector: Timelines - Cannot export on about:blank - suggested filename containing a colon silently fails | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||
| Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ews-watchlist, hi, inspector-bugzilla-changes, joepeck, timothy, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
Joseph Pecoraro
2019-03-21 13:15:48 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. Created attachment 365623 [details]
[PATCH] Proposed Fix
Not sure if `inspectorURLForFilename` is the best name, open to suggestions.
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). Committed r243355 <https://trac.webkit.org/changeset/243355>. |