Add Mini Profiler support to Ember CLI (#12970)

This commit is contained in:
Robin Ward 2021-05-06 11:54:17 -04:00 committed by GitHub
parent 82ecd9fdd5
commit 1bc6fdd41d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@ const { encode } = require("html-entities");
const cleanBaseURL = require("clean-base-url");
const path = require("path");
const fs = require("fs");
const crypto = require("crypto");
const IGNORE_PATHS = [
/\/ember-cli-live-reload\.js$/,
@ -92,6 +93,11 @@ function body(buffer, bootstrap) {
function bodyFooter(buffer, bootstrap) {
buffer.push(bootstrap.theme_html.body_tag);
buffer.push(bootstrap.html.before_body_close);
let v = crypto.randomUUID();
buffer.push(`
<script async type="text/javascript" id="mini-profiler" src="/mini-profiler-resources/includes.js?v=${v}" data-css-url="/mini-profiler-resources/includes.css?v=${v}" data-version="${v}" data-path="/mini-profiler-resources/" data-horizontal-position="left" data-vertical-position="top" data-trivial="false" data-children="false" data-max-traces="20" data-controls="false" data-total-sql-count="false" data-authorized="true" data-toggle-shortcut="alt+p" data-start-hidden="false" data-collapse-results="true" data-html-container="body" data-hidden-custom-fields="" data-ids=""></script>
`);
}
function hiddenLoginForm(buffer, bootstrap) {