[Webkit-unassigned] [Bug 118715] Web Inspector: InspectorFrontendHost is undefined

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 16 07:14:58 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=118715





--- Comment #5 from Timothy Hatcher <timothy at apple.com>  2013-07-16 07:15:09 PST ---
(From update of attachment 206732)
View in context: https://bugs.webkit.org/attachment.cgi?id=206732&action=review

Thanks for doing this!

> Source/WebInspectorUI/ChangeLog:12
> +        There are some referenced files that also copied:
> +            * View.js
> +            * HelpScreen.js / css
> +        Added a 'Preferences' variable to the Setting.js because the InspectorFrontendHostStub.js uses it.

We want to be very selective when copying code from the deprecated Web Inspector. These things are items we don't want to bring over. This change should just have the bare minimum needed to add InspectorFrontendHostStub.js. I've commented on the patch where you can remove these dependencies and still should get a working Inspector with the minimum required.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:31
> +if (!window.InspectorFrontendHost) {

You should indent the body of the block.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:36
> +/**
> + * @constructor
> + * @implements {InspectorFrontendHostAPI}
> + */

We don't use. Remove.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:40
> +    this.isStub = true;

We don't use. Remove.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:42
> +    WebInspector.documentCopyEventFired = this.documentCopy.bind(this);

Remove.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:91
> +    setInjectedScriptForOrigin: function(origin, script)
> +    {
> +    },

We don't use. Remove.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:104
> +        document.title = WebInspector.UIString(Preferences.applicationTitle, url);

This should not use Preferences. In our UI url is really title. So rename url to title and just set document.title = title;

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:107
> +    documentCopy: function(event)

I don't think we use this.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:121
> +            var screen = new WebInspector.ClipboardAccessDeniedScreen();
> +            screen.showModal();

Remove. Just add a console.error.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:141
> +        setTimeout(WebInspector.fileManager.savedURL.bind(WebInspector.fileManager, url), 0);

We don't have fileManager. You can remove this.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:151
> +        setTimeout(WebInspector.fileManager.appendedToURL.bind(WebInspector.fileManager, url), 0);

Ditto.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:163
> +        var fileNameSuffix = (lastSlashIndex === -1) ? url : url.substring(lastSlashIndex + 1);

Remove () around (lastSlashIndex === -1).

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:165
> +        var blob = new Blob(content, { type: "application/octet-stream" });

Remove spaces inside {} except after :.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:178
> +    sendMessageToBackend: function(message)
> +    {
> +    },

I don't like how sendMessageToBackend is replaced dynamically later by the WebSocket code. This function should just know how to use the WebSocket if it exists.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:190
> +    recordActionTaken: function(actionCode)
> +    {
> +    },
> +
> +    recordPanelShown: function(panelCode)
> +    {
> +    },
> +
> +    recordSettingChanged: function(settingCode)
> +    {
> +    },

We don't use these user tracking functions. Remove.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:194
> +        return loadXHR(url);

We don't have a loadXHR function. Just inline it here.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:226
> +    supportsFileSystems: function()
> +    {
> +        return false;
> +    },
> +
> +    requestFileSystems: function()
> +    {
> +    },
> +
> +    addFileSystem: function()
> +    {
> +    },
> +
> +    removeFileSystem: function(fileSystemPath)
> +    {
> +    },
> +
> +    isolatedFileSystem: function(fileSystemId, registeredName)
> +    {
> +        return null;
> +    },
> +
> +    setZoomFactor: function(zoom)
> +    {
> +    },
> +
> +    isUnderTest: function()
> +    {
> +        return false;
> +    }

We don't use, remove.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:230
> +Preferences.localizeUI = false;

Remove.

> Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js:276
> +// Default implementation; platforms will override.
> +WebInspector.clipboardAccessDeniedMessage = function()
> +{
> +    return "";
> +}
> +
> +/**
> + * @constructor
> + * @extends {WebInspector.HelpScreen}
> + */
> +WebInspector.ClipboardAccessDeniedScreen = function()
> +{
> +    WebInspector.HelpScreen.call(this, WebInspector.UIString("Clipboard access is denied"));
> +    var platformMessage = WebInspector.clipboardAccessDeniedMessage();
> +    if (platformMessage) {
> +        var p = this.contentElement.createChild("p");
> +        p.addStyleClass("help-section");
> +        p.textContent = platformMessage;
> +    }
> +}
> +
> +WebInspector.ClipboardAccessDeniedScreen.prototype = {
> +    __proto__: WebInspector.HelpScreen.prototype
> +}
> +
> +}
> +
> +/**
> + * @constructor
> + * @extends {WebInspector.HelpScreen}
> + */
> +WebInspector.RemoteDebuggingTerminatedScreen = function(reason)
> +{
> +    WebInspector.HelpScreen.call(this, WebInspector.UIString("Detached from the target"));
> +    var p = this.contentElement.createChild("p");
> +    p.addStyleClass("help-section");
> +    p.createChild("span").textContent = "Remote debugging has been terminated with reason: ";
> +    p.createChild("span", "error-message").textContent = reason;
> +    p.createChild("br");
> +    p.createChild("span").textContent = "Please re-attach to the new target.";
> +}
> +
> +WebInspector.RemoteDebuggingTerminatedScreen.prototype = {
> +    __proto__: WebInspector.HelpScreen.prototype
> +}

Remove.

> Source/WebInspectorUI/UserInterface/Main.html:119
> +    <link rel="stylesheet" href="HelpScreen.css">

Remove.

> Source/WebInspectorUI/UserInterface/Main.html:147
> +    <script src="View.js"></script>
> +    <script src="HelpScreen.js"></script>

Remove.

> Source/WebInspectorUI/UserInterface/Setting.js:36
> +var Preferences = {
> +    localizeUI: true,
> +    applicationTitle: "Web Inspector - %s",
> +}
> +

Remove.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list