Bug 166895

Summary: Web Inspector: Cannot edit source code of HTML or JS resources served via HTTP
Product: WebKit Reporter: Cigitia <cigitia>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: inspector-bugzilla-changes, jschoi
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Simple test-case reduction. none

Description Cigitia 2017-01-10 10:59:45 PST
Created attachment 298484 [details]
Simple test-case reduction.

Macintosh. macOS 10.12.2 (16C67).

When a webpage is opened with Web Inspector (e.g., in WebKit 12602.3.12.0.1, r210538), and its resources are served via HTTP, including when from localhost, its HTML and JavaScript resources’ source code cannot be edited. In contrast, when JavaScript resources are served directly from local files using file:///, they can indeed be edited. In addition, CSS resources’ source code can be edited whether they are served via http: or file:.

Steps to reproduce:
1. Download and decompress the webkit-inspector-bug.zip attachment, which contains these files: index.html, style.css, and main.js.

2a. In WebKit, open index.html as a local file using file:.
2b. Show Web Inspector’s Resources tab.
2c. Confirm that the source code of index.html, style.css, and main.js is editable.

3a. Open a terminal and change its working directory to the decompressed directory webkit-inspector-bug/.
3b. Start a simple HTTP server at the directory, such as python -m SimpleHTTPServer, which would serve to localhost:8000.
3c. Open the index.html webpage as is served by HTTP server, e.g., localhost:8000 for the Python command above.
3d. Confirm that, while the source code of style.css is still editable, the source code of index.html and main.js is no longer editable.

Notes:
Resources can still be saved to local files using ⌘S, whether or not they are normally editable or abnormally uneditable.
Comment 1 Cigitia 2017-11-15 10:58:25 PST
See also: #16477 ”Web Inspector should allow live editing of JavaScript code” (https://bugs.webkit.org/show_bug.cgi?id= 16477).