In order to improve the (re)load time of Safari Web Inspector you have to modify /System/Library/PrivateFrameworks/WebInspectorUI.framework/Versions/A/Resources/Main.js
file.
Comment or remove the following three lines (TimelineManager.js
in the unminified source):
WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ProvisionalLoadStarted, this._startAutoRecording, this);
WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
Reimplement WebInspector.dispatchMessageFromBackend
method (Main.js
in the unminified source) as follows:
WebInspector.dispatchMessageFromBackend = function(message) {
// Enforce asynchronous interaction between the backend and the frontend by queueing messages.
// The messages are dequeued on a zero delay timeout.
this.messagesToDispatch.push(message);
if (message.method == 'Page.frameStartedLoading') {
this._isLoading = true;
this.consoleContentView._clearLog();
this.quickConsole.prompt.text = '';
}
else if (message.method == 'Page.frameStoppedLoading') {
this._isLoading = false;
}
if (this._dispatchTimeout || this._isLoading) {
return;
}
this._dispatchTimeout = setTimeout(this.dispatchNextQueuedMessageFromBackend.bind(this), 0);
}