Changeset 251921 in webkit


Ignore:
Timestamp:
Nov 1, 2019 9:08:33 AM (4 years ago)
Author:
Devin Rousso
Message:

Web Inspector: make the default content of the Inspector Bootstrap Script a comment that explains how it works
https://bugs.webkit.org/show_bug.cgi?id=203704

Reviewed by Timothy Hatcher.

  • UserInterface/Controllers/NetworkManager.js:

(WI.NetworkManager.prototype.async createBootstrapScript):

  • Localizations/en.lproj/localizedStrings.js:
Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r251919 r251921  
     12019-11-01  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: make the default content of the Inspector Bootstrap Script a comment that explains how it works
     4        https://bugs.webkit.org/show_bug.cgi?id=203704
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Controllers/NetworkManager.js:
     9        (WI.NetworkManager.prototype.async createBootstrapScript):
     10
     11        * Localizations/en.lproj/localizedStrings.js:
     12
    1132019-11-01  Devin Rousso  <drousso@apple.com>
    214
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r251871 r251921  
    635635localizedStrings["Invisible characters"] = "Invisible characters";
    636636localizedStrings["Invoke getter"] = "Invoke getter";
     637localizedStrings["It is evaluated immediately after the global object is created, before any other content has loaded."] = "It is evaluated immediately after the global object is created, before any other content has loaded.";
    637638localizedStrings["JP2"] = "JP2";
    638639localizedStrings["JPEG"] = "JPEG";
     
    715716localizedStrings["Missing result level"] = "Missing result level";
    716717localizedStrings["Mixed"] = "Mixed";
     718localizedStrings["Modifications made here will take effect on the next load of any page or sub-frame."] = "Modifications made here will take effect on the next load of any page or sub-frame.";
    717719localizedStrings["Module Code"] = "Module Code";
    718720localizedStrings["Multi-Entry"] = "Multi-Entry";
     
    10581060localizedStrings["Socket"] = "Socket";
    10591061localizedStrings["Sockets"] = "Sockets";
     1062localizedStrings["Some examples of ways to use this script include (but are not limited to):"] = "Some examples of ways to use this script include (but are not limited to):";
    10601063localizedStrings["Sort Ascending"] = "Sort Ascending";
    10611064localizedStrings["Sort Descending"] = "Sort Descending";
     
    11221125localizedStrings["Text Frame"] = "Text Frame";
    11231126localizedStrings["Text Node"] = "Text Node";
     1127localizedStrings["The Inspector Bootstrap Script is guaranteed to be the first script evaluated in any page, as well as any sub-frames."] = "The Inspector Bootstrap Script is guaranteed to be the first script evaluated in any page, as well as any sub-frames.";
    11241128localizedStrings["The \u201C%s\u201D audit failed"] = "The \u201C%s\u201D audit failed";
    11251129localizedStrings["The \u201C%s\u201D audit is unsupported"] = "The \u201C%s\u201D audit is unsupported";
     
    11281132localizedStrings["The \u201C%s\u201D audit threw an error"] = "The \u201C%s\u201D audit threw an error";
    11291133localizedStrings["The \u201C%s\u201D\ntable is empty."] = "The \u201C%s\u201D\ntable is empty.";
     1134localizedStrings["The contents and enabled state will be preserved across Web Inspector sessions."] = "The contents and enabled state will be preserved across Web Inspector sessions.";
    11301135localizedStrings["The page's content has changed"] = "The page's content has changed";
    11311136localizedStrings["The resource was requested insecurely."] = "The resource was requested insecurely.";
     
    12971302localizedStrings["default"] = "default";
    12981303localizedStrings["default prevented"] = "default prevented";
     1304localizedStrings["ensuring that common debugging functions are available on every page via the Console"] = "ensuring that common debugging functions are available on every page via the Console";
    12991305localizedStrings["for changes to take effect"] = "for changes to take effect";
    13001306localizedStrings["invalid HAR"] = "invalid HAR";
     
    13081314localizedStrings["non-string %s"] = "non-string %s";
    13091315localizedStrings["originally %s"] = "originally %s";
     1316localizedStrings["overriding built-in functions to log call traces or add `debugger` statements"] = "overriding built-in functions to log call traces or add `debugger` statements";
    13101317localizedStrings["popup"] = "popup";
    13111318localizedStrings["popup, toggle"] = "popup, toggle";
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js

    r251531 r251921  
    298298            source = await WI.objectStores.general.get(NetworkManager.bootstrapScriptSourceObjectStoreKey);
    299299
     300        if (!source) {
     301            source = `
     302/*
     303 * ${WI.UIString("The Inspector Bootstrap Script is guaranteed to be the first script evaluated in any page, as well as any sub-frames.")}
     304 * ${WI.UIString("It is evaluated immediately after the global object is created, before any other content has loaded.")}
     305 *
     306 * ${WI.UIString("Modifications made here will take effect on the next load of any page or sub-frame.")}
     307 * ${WI.UIString("The contents and enabled state will be preserved across Web Inspector sessions.")}
     308 *
     309 * ${WI.UIString("Some examples of ways to use this script include (but are not limited to):")}
     310 *  - ${WI.UIString("overriding built-in functions to log call traces or add `debugger` statements")}
     311 *  - ${WI.UIString("ensuring that common debugging functions are available on every page via the Console")}
     312 */
     313`;
     314        }
     315
    300316        const target = null;
    301317        const url = null;
    302318        const sourceURL = NetworkManager.bootstrapScriptURL;
    303         this._bootstrapScript = new WI.LocalScript(target, url, sourceURL, WI.Script.SourceType.Program, source || "", {injected: true, editable: true});
     319        this._bootstrapScript = new WI.LocalScript(target, url, sourceURL, WI.Script.SourceType.Program, source, {injected: true, editable: true});
    304320        this._bootstrapScript.addEventListener(WI.SourceCode.Event.ContentDidChange, this._handleBootstrapScriptContentDidChange, this);
    305321
Note: See TracChangeset for help on using the changeset viewer.