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)
Created attachment 13049 [details] Crash Log
Confirmed, we should definitely handle this more gracefully.
Reproducible crashers are P1. This probably also needs a Radar bug.
We probably want to make the inspector window ignore the JS preference setting.
<rdar://problem/4990045>
(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.
Created attachment 13170 [details] Attempted patch Prompt the user to enable JS if it's disabled, otherwise bail.
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?
(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 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.
*** Bug 12958 has been marked as a duplicate of this bug. ***
*** Bug 14286 has been marked as a duplicate of this bug. ***
<rdar://problem/4618350>
*** Bug 16203 has been marked as a duplicate of this bug. ***
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.
*** Bug 17348 has been marked as a duplicate of this bug. ***
The Inspector no longer crashes when JavaScript is disabled. It now opens in an unusable state.
*** Bug 21640 has been marked as a duplicate of this bug. ***
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).
Inspector should fail gracefully, displaying a correct error message to the user, rather than crash the browser
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.