Bug 166895 - Web Inspector: Cannot edit source code of HTML or JS resources served via HTTP
Summary: Web Inspector: Cannot edit source code of HTML or JS resources served via HTTP
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-10 10:59 PST by Cigitia
Modified: 2018-02-06 14:19 PST (History)
2 users (show)

See Also:


Attachments
Simple test-case reduction. (4.34 KB, application/zip)
2017-01-10 10:59 PST, Cigitia
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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).