local_state.ts 910 B

1234567891011121314151617181920212223242526
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. /**
  5. * Javascript for local_state.html, served from chrome://local-state/
  6. * This is used to debug the contents of the Local State file.
  7. */
  8. // <if expr="is_ios">
  9. // This is needed for the iOS implementation of chrome.send (to communicate
  10. // between JS and native).
  11. // TODO(crbug.com/487000): Remove this once injected by web.
  12. import 'chrome://resources/js/ios/web_ui.js';
  13. // </if>
  14. import {sendWithPromise} from 'chrome://resources/js/cr.m.js';
  15. import {$} from 'chrome://resources/js/util.m.js';
  16. // When the page loads, request the JSON local state data from C++.
  17. document.addEventListener('DOMContentLoaded', function() {
  18. sendWithPromise('requestJson').then((localState: string) => {
  19. $('content').textContent = localState;
  20. });
  21. });