Bug 12693 - Inspector doesn't work when JavaScript is disabled
Summary: Inspector doesn't work when JavaScript is disabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 12958 14286 16203 17348 21640 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-02-08 00:34 PST by Elliott Sprehn
Modified: 2014-01-12 10:48 PST (History)
11 users (show)

See Also:


Attachments
Crash Log (23.26 KB, text/plain)
2007-02-08 00:35 PST, Elliott Sprehn
no flags Details
Attempted patch (1.77 KB, patch)
2007-02-14 11:05 PST, Matt Lilek
darin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Sprehn 2007-02-08 00:34:35 PST
If Javascript is disabled in the browser preferences and the Inspector is launched using the context menu the browser crashes.

Crash dump is attached.

Also it seems Webkit is reporting the image as /Applications/Safari.app/Contents/MacOS/Safari despite the fact that it exists at /Applications/Webkit/Webkit.app/Contents/MacOS/Webkit

Reproducible in the latest nightly build. (Thu Feb 8 6:10:29 GMT 2007)
Comment 1 Elliott Sprehn 2007-02-08 00:35:48 PST
Created attachment 13049 [details]
Crash Log
Comment 2 Matt Lilek 2007-02-08 07:02:21 PST
Confirmed, we should definitely handle this more gracefully.
Comment 3 David Kilzer (:ddkilzer) 2007-02-08 07:23:57 PST
Reproducible crashers are P1.  This probably also needs a Radar bug.

Comment 4 Maciej Stachowiak 2007-02-10 15:00:47 PST
We probably want to make the inspector window ignore the JS preference setting.
Comment 5 Maciej Stachowiak 2007-02-10 19:13:34 PST
<rdar://problem/4990045>
Comment 6 Alexey Proskuryakov 2007-02-10 23:45:39 PST
(In reply to comment #4)
> We probably want to make the inspector window ignore the JS preference setting.

We already do - the crash happens because the inspector wants to access nodes in the actual document, and they cannot be wrapped in JS objects if JS is disabled in it.
Comment 7 Matt Lilek 2007-02-14 11:05:09 PST
Created attachment 13170 [details]
Attempted patch

Prompt the user to enable JS if it's disabled, otherwise bail.
Comment 8 Darin Adler 2007-02-14 11:07:38 PST
Comment on attachment 13170 [details]
Attempted patch

This doesn't look like the right solution to me. Can't the web inspector use JavaScript even if it's turned off for the web page itself?
Comment 9 Darin Adler 2007-02-14 11:08:19 PST
(In reply to comment #6)
> We already do - the crash happens because the inspector wants to access nodes
> in the actual document, and they cannot be wrapped in JS objects if JS is
> disabled in it.

I think we should fix that.
Comment 10 Darin Adler 2007-02-15 09:51:02 PST
Comment on attachment 13170 [details]
Attempted patch

This is not the right fix. We should not be enabling JavaScript and overriding what the application is doing, even for the web inspector. Instead we need to fix the logic so that the inspector will successfully get JavaScript wrappers even though JavaScript is off for the target WebView.
Comment 11 Matt Lilek 2007-03-03 12:28:25 PST
*** Bug 12958 has been marked as a duplicate of this bug. ***
Comment 12 Timothy Hatcher 2007-06-24 11:44:46 PDT
*** Bug 14286 has been marked as a duplicate of this bug. ***
Comment 13 Oliver Hunt 2007-07-13 21:59:21 PDT
<rdar://problem/4618350>
Comment 14 mitz 2007-11-30 19:33:00 PST
*** Bug 16203 has been marked as a duplicate of this bug. ***
Comment 15 Glan Thomas 2007-12-01 04:41:01 PST
I guess a quick solution might be disable/gray-out the web inspector if javascript is disabled or prompt the user that javascript must be enabled to use the web inspector.

They are not perfect, but avoid causing a crash. In any case the inspector is ont quite as useful without javascript enabled, as page DOM wouldn't have changed so the source structure would be the same.
Comment 16 Matt Lilek 2008-02-13 16:07:27 PST
*** Bug 17348 has been marked as a duplicate of this bug. ***
Comment 17 Adam Roben (:aroben) 2008-03-13 22:44:01 PDT
The Inspector no longer crashes when JavaScript is disabled. It now opens in an unusable state.
Comment 18 Timothy Hatcher 2008-10-16 16:29:37 PDT
*** Bug 21640 has been marked as a duplicate of this bug. ***
Comment 19 Matthew Hutton 2009-07-07 01:34:53 PDT
It should at least display a warning when you try and run the inspector with Javascript disabled - I wasted a fair bit of time thinking it was completely broken because I'd forgotten I'd disabled Javascript in Safari (for web development too :p).
Comment 20 Alexei Masterov 2010-07-08 07:58:07 PDT
Inspector should fail gracefully, displaying a correct error message to the user, rather than crash the browser
Comment 21 Brian Burg 2014-01-12 10:48:10 PST
In recent versions of inspector, there is no crash and the inspector still works correctly. It may be a good idea to disable the Debugger sidebar panel when the page's JavaScript is disabled, but that's a separate bug.