tree: 34b63432814dcfc00919f8222c0f8c4a2b3b806b [path history] [tgz]
  1. App.ts
  2. AppProvider.ts
  3. Base64.test.ts
  4. Base64.ts
  5. BUILD.gn
  6. CharacterIdMap.test.ts
  7. CharacterIdMap.ts
  8. Color.test.ts
  9. Color.ts
  10. ColorConverter.test.ts
  11. ColorConverter.ts
  12. ColorUtils.test.ts
  13. ColorUtils.ts
  14. common.ts
  15. Console.test.ts
  16. Console.ts
  17. Debouncer.test.ts
  18. Debouncer.ts
  19. EventTarget.test.ts
  20. EventTarget.ts
  21. JavaScriptMetaData.ts
  22. Lazy.test.ts
  23. Lazy.ts
  24. Linkifier.ts
  25. Mutex.test.ts
  26. Mutex.ts
  27. Object.test.ts
  28. Object.ts
  29. OWNERS
  30. ParsedURL.test.ts
  31. ParsedURL.ts
  32. Progress.test.ts
  33. Progress.ts
  34. QueryParamHandler.ts
  35. README.md
  36. ResolverBase.test.ts
  37. ResolverBase.ts
  38. ResourceType.test.ts
  39. ResourceType.ts
  40. Revealer.test.ts
  41. Revealer.ts
  42. Runnable.ts
  43. SegmentedRange.test.ts
  44. SegmentedRange.ts
  45. SettingRegistration.test.ts
  46. SettingRegistration.ts
  47. Settings.test.ts
  48. Settings.ts
  49. SimpleHistoryManager.test.ts
  50. SimpleHistoryManager.ts
  51. StringOutputStream.test.ts
  52. StringOutputStream.ts
  53. TextDictionary.test.ts
  54. TextDictionary.ts
  55. Throttler.test.ts
  56. Throttler.ts
  57. Trie.test.ts
  58. Trie.ts
  59. Worker.ts
front_end/core/common/README.md

Settings

Settings can alter the functionality of DevTools. Some of the settings default values can be changed with the command menu or in the settings tab. A settings registration is represented by the SettingRegistration interface, declared in common/SettingRegistration.ts.

All settings have to be registered using the function Common.Settings.registerSettingExtension which expects an object of type SettingRegistration as parameter.

As an example, take the registration of the showHTMLComments settting, which allows users to determine if HTML comments are shown in the Elements tree:

Common.Settings.registerSettingExtension({
  category:  Common.Settings.SettingCategory.ELEMENTS,
  order:  3,
  title:  ls`Show HTML comments`,
  settingName:  'showHTMLComments',
  settingType:  Common.Settings.SettingType.BOOLEAN,
  defaultValue:  true,
  options: [
    {
      value:  true,
      title:  ls`Show HTML comments`,
    },
    {
      value:  false,
      title:  ls`Hide HTML comments`,
    },
  ],
});

A controller for the each setting is added to the ‘preferences’ tab if they are visible, that is, they have a title and a category. They can also be set with the command menu if they have options and a category (options’ names are added as commands).