/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict";
// We directly require Components that we know are going to be used right away const ConsoleOutput = createFactory(
require("resource://devtools/client/webconsole/components/Output/ConsoleOutput.js")
); const FilterBar = createFactory(
require("resource://devtools/client/webconsole/components/FilterBar/FilterBar.js")
); const ReverseSearchInput = createFactory(
require("resource://devtools/client/webconsole/components/Input/ReverseSearchInput.js")
); const JSTerm = createFactory(
require("resource://devtools/client/webconsole/components/Input/JSTerm.js")
); const ConfirmDialog = createFactory(
require("resource://devtools/client/webconsole/components/Input/ConfirmDialog.js")
); const EagerEvaluation = createFactory(
require("resource://devtools/client/webconsole/components/Input/EagerEvaluation.js")
); const EvaluationNotification = createFactory(
require("resource://devtools/client/webconsole/components/Input/EvaluationNotification.js")
);
// And lazy load the ones that may not be used.
loader.lazyGetter(this, "SideBar", () =>
createFactory(
require("resource://devtools/client/webconsole/components/SideBar.js")
)
);
// Do not focus on middle/right-click or 2+ clicks. if (event.detail !== 1 || event.button !== 0) { return;
}
// Do not focus if a link was clicked if (target.closest("a")) { return;
}
// Do not focus if an input field was clicked if (target.closest("input")) { return;
}
// Do not focus if the click happened in the reverse search toolbar. if (target.closest(".reverse-search")) { return;
}
// Do not focus if something other than the output region was clicked // (including e.g. the clear messages button in toolbar) if (!target.closest(".webconsole-app")) { return;
}
// Do not focus if something is selected const selection = webConsoleUI.document.defaultView.getSelection(); if (selection && !selection.isCollapsed) { return;
}
if (webConsoleUI?.jsterm) {
webConsoleUI.jsterm.focus();
}
}
// Bail out if self-xss notification is suppressed. if (
webConsoleUI.isBrowserConsole ||
usageCount >= CONSOLE_ENTRY_THRESHOLD
) { return;
}
// Stop event propagation, so the clipboard content is *not* inserted.
event.preventDefault();
event.stopPropagation();
// Bail out if self-xss notification is already there. if (getNotificationWithValue(notifications, "selfxss-notification")) { return;
}
const input = event.target;
// Cleanup function if notification is closed by the user. const removeCallback = eventType => { if (eventType == "removed") {
input.removeEventListener("keyup", pasteKeyUpHandler);
dispatch(actions.removeNotification("selfxss-notification"));
}
};
renderChromeDebugToolbar() { const { webConsoleUI } = this.props; if (!webConsoleUI.isBrowserConsole) { returnnull;
} return ChromeDebugToolbar({ // This should always be true at this point
isBrowserConsole: webConsoleUI.isBrowserConsole,
});
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.